summaryrefslogtreecommitdiff
path: root/zp/source/any/mth/vsub.cc
diff options
context:
space:
mode:
Diffstat (limited to 'zp/source/any/mth/vsub.cc')
-rw-r--r--zp/source/any/mth/vsub.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/zp/source/any/mth/vsub.cc b/zp/source/any/mth/vsub.cc
new file mode 100644
index 0000000..58977a4
--- /dev/null
+++ b/zp/source/any/mth/vsub.cc
@@ -0,0 +1,21 @@
+/*
+ Copyright 2022-2023 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
+*/
+
+#include <zp/mth>
+
+extern "C" {
+ auto zp_v2subf( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vsub(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2subd( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vsub(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();}
+ auto zp_v2subld(::zp_vec2ld const lvec,::zp_vec2ld const rvec) -> ::zp_vec2ld {return ::zp::vsub(::zp::vec2<long double> {lvec.x,lvec.y,},::zp::vec2<long double> {rvec.x,rvec.y,}).cvec();}
+
+ auto zp_v3subf( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vsub(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3subd( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vsub(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+ auto zp_v3subld(::zp_vec3ld const lvec,::zp_vec3ld const rvec) -> ::zp_vec3ld {return ::zp::vsub(::zp::vec3<long double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<long double> {rvec.x,rvec.y,rvec.z,}).cvec();}
+
+ auto zp_v4subf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vsub(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4subd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vsub(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+ auto zp_v4subld(::zp_vec4ld const lvec,::zp_vec4ld const rvec) -> ::zp_vec4ld {return ::zp::vsub(::zp::vec4<long double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<long double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();}
+}