50#if defined(RAYMATH_IMPLEMENTATION) && defined(RAYMATH_STATIC_INLINE)
51 #error "Specifying both RAYMATH_IMPLEMENTATION and RAYMATH_STATIC_INLINE is contradictory"
55#if defined(RAYMATH_IMPLEMENTATION)
56 #if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED)
57 #define RMAPI __declspec(dllexport) extern inline
58 #elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED)
59 #define RMAPI __declspec(dllimport)
61 #define RMAPI extern inline
63#elif defined(RAYMATH_STATIC_INLINE)
64 #define RMAPI static inline
66 #if defined(__TINYC__)
67 #define RMAPI static inline
77 #define PI 3.14159265358979323846f
81 #define EPSILON 0.000001f
85 #define DEG2RAD (PI/180.0f)
89 #define RAD2DEG (180.0f/PI)
94 #define MatrixToFloat(mat) (MatrixToFloatV(mat).v)
99 #define Vector3ToFloat(vec) (Vector3ToFloatV(vec).v)
105#if !defined(RL_VECTOR2_TYPE)
111#define RL_VECTOR2_TYPE
114#if !defined(RL_VECTOR3_TYPE)
121#define RL_VECTOR3_TYPE
124#if !defined(RL_VECTOR4_TYPE)
132#define RL_VECTOR4_TYPE
135#if !defined(RL_QUATERNION_TYPE)
138#define RL_QUATERNION_TYPE
141#if !defined(RL_MATRIX_TYPE)
149#define RL_MATRIX_TYPE
170 float result = (value < min)? min : value;
172 if (result > max) result = max;
180 float result = start + amount*(end - start);
188 float result = (value - start)/(end - start);
194RMAPI float Remap(
float value,
float inputStart,
float inputEnd,
float outputStart,
float outputEnd)
196 float result = (value - inputStart)/(inputEnd - inputStart)*(outputEnd - outputStart) + outputStart;
204 int result = (fabsf(x - y)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(x), fabsf(y))));
216 Vector2 result = { 0.0f, 0.0f };
224 Vector2 result = { 1.0f, 1.0f };
240 Vector2 result = { v.
x + add, v.
y + add };
256 Vector2 result = { v.
x - sub, v.
y - sub };
264 float result = sqrtf((v.
x*v.
x) + (v.
y*v.
y));
272 float result = (v.
x*v.
x) + (v.
y*v.
y);
280 float result = (v1.
x*v2.
x + v1.
y*v2.
y);
288 float result = sqrtf((v1.
x - v2.
x)*(v1.
x - v2.
x) + (v1.
y - v2.
y)*(v1.
y - v2.
y));
296 float result = ((v1.
x - v2.
x)*(v1.
x - v2.
x) + (v1.
y - v2.
y)*(v1.
y - v2.
y));
304 float result = atan2f(v2.
y, v2.
x) - atan2f(v1.
y, v1.
x);
312 Vector2 result = { v.
x*scale, v.
y*scale };
345 float length = sqrtf((v.
x*v.
x) + (v.
y*v.
y));
349 float ilength = 1.0f/length;
350 result.
x = v.
x*ilength;
351 result.
y = v.
y*ilength;
366 result.
x = mat.
m0*x + mat.
m4*y + mat.
m8*z + mat.
m12;
367 result.
y = mat.
m1*x + mat.
m5*y + mat.
m9*z + mat.
m13;
377 result.
x = v1.
x + amount*(v2.
x - v1.
x);
378 result.
y = v1.
y + amount*(v2.
y - v1.
y);
388 float dotProduct = (v.
x*normal.
x + v.
y*normal.
y);
390 result.
x = v.
x - (2.0f*normal.
x)*dotProduct;
391 result.
y = v.
y - (2.0f*normal.
y)*dotProduct;
401 float cosres = cosf(angle);
402 float sinres = sinf(angle);
404 result.
x = v.
x*cosres - v.
y*sinres;
405 result.
y = v.
x*sinres + v.
y*cosres;
415 float dx = target.
x - v.
x;
416 float dy = target.
y - v.
y;
417 float value = (dx*dx) + (dy*dy);
419 if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance)))
return target;
421 float dist = sqrtf(value);
423 result.
x = v.
x + dx/dist*maxDistance;
424 result.
y = v.
y + dy/dist*maxDistance;
443 result.
x = fminf(max.
x, fmaxf(min.
x, v.
x));
444 result.
y = fminf(max.
y, fmaxf(min.
y, v.
y));
454 float length = (v.
x*v.
x) + (v.
y*v.
y);
457 length = sqrtf(length);
461 float scale = min/length;
462 result.
x = v.
x*scale;
463 result.
y = v.
y*scale;
465 else if (length > max)
467 float scale = max/length;
468 result.
x = v.
x*scale;
469 result.
y = v.
y*scale;
479 int result = ((fabsf(p.
x - q.
x)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
x), fabsf(q.
x))))) &&
480 ((fabsf(p.
y - q.
y)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
y), fabsf(q.
y)))));
492 Vector3 result = { 0.0f, 0.0f, 0.0f };
500 Vector3 result = { 1.0f, 1.0f, 1.0f };
516 Vector3 result = { v.
x + add, v.
y + add, v.
z + add };
532 Vector3 result = { v.
x - sub, v.
y - sub, v.
z - sub };
540 Vector3 result = { v.
x*scalar, v.
y*scalar, v.
z*scalar };
566 float min = (float) fabs(v.
x);
567 Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f};
569 if (fabsf(v.
y) < min)
571 min = (float) fabs(v.
y);
572 Vector3 tmp = {0.0f, 1.0f, 0.0f};
576 if (fabsf(v.
z) < min)
578 Vector3 tmp = {0.0f, 0.0f, 1.0f};
583 result.
x = v.
y*cardinalAxis.
z - v.
z*cardinalAxis.
y;
584 result.
y = v.
z*cardinalAxis.
x - v.
x*cardinalAxis.
z;
585 result.
z = v.
x*cardinalAxis.
y - v.
y*cardinalAxis.
x;
593 float result = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
601 float result = v.
x*v.
x + v.
y*v.
y + v.
z*v.
z;
609 float result = (v1.
x*v2.
x + v1.
y*v2.
y + v1.
z*v2.
z);
619 float dx = v2.
x - v1.
x;
620 float dy = v2.
y - v1.
y;
621 float dz = v2.
z - v1.
z;
622 result = sqrtf(dx*dx + dy*dy + dz*dz);
632 float dx = v2.
x - v1.
x;
633 float dy = v2.
y - v1.
y;
634 float dz = v2.
z - v1.
z;
635 result = dx*dx + dy*dy + dz*dz;
646 float len = sqrtf(cross.
x*cross.
x + cross.
y*cross.
y + cross.
z*cross.
z);
647 float dot = (v1.
x*v2.
x + v1.
y*v2.
y + v1.
z*v2.
z);
648 result = atan2f(len, dot);
674 float length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
675 if (length == 0.0f) length = 1.0f;
676 float ilength = 1.0f/length;
691 float ilength = 0.0f;
695 length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
696 if (length == 0.0f) length = 1.0f;
697 ilength = 1.0f/length;
703 Vector3 vn1 = { v1->
y*v2->
z - v1->
z*v2->
y, v1->
z*v2->
x - v1->
x*v2->
z, v1->
x*v2->
y - v1->
y*v2->
x };
707 length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
708 if (length == 0.0f) length = 1.0f;
709 ilength = 1.0f/length;
715 Vector3 vn2 = { vn1.
y*v1->
z - vn1.
z*v1->
y, vn1.
z*v1->
x - vn1.
x*v1->
z, vn1.
x*v1->
y - vn1.
y*v1->
x };
729 result.
x = mat.
m0*x + mat.
m4*y + mat.
m8*z + mat.
m12;
730 result.
y = mat.
m1*x + mat.
m5*y + mat.
m9*z + mat.
m13;
731 result.
z = mat.
m2*x + mat.
m6*y + mat.
m10*z + mat.
m14;
741 result.
x = v.
x*(q.
x*q.
x + q.
w*q.
w - q.
y*q.
y - q.
z*q.
z) + v.
y*(2*q.
x*q.
y - 2*q.
w*q.
z) + v.
z*(2*q.
x*q.
z + 2*q.
w*q.
y);
742 result.
y = v.
x*(2*q.
w*q.
z + 2*q.
x*q.
y) + v.
y*(q.
w*q.
w - q.
x*q.
x + q.
y*q.
y - q.
z*q.
z) + v.
z*(-2*q.
w*q.
x + 2*q.
y*q.
z);
743 result.
z = v.
x*(-2*q.
w*q.
y + 2*q.
x*q.
z) + v.
y*(2*q.
w*q.
x + 2*q.
y*q.
z)+ v.
z*(q.
w*q.
w - q.
x*q.
x - q.
y*q.
y + q.
z*q.
z);
753 result.
x = v1.
x + amount*(v2.
x - v1.
x);
754 result.
y = v1.
y + amount*(v2.
y - v1.
y);
755 result.
z = v1.
z + amount*(v2.
z - v1.
z);
769 float dotProduct = (v.
x*normal.
x + v.
y*normal.
y + v.
z*normal.
z);
771 result.
x = v.
x - (2.0f*normal.
x)*dotProduct;
772 result.
y = v.
y - (2.0f*normal.
y)*dotProduct;
773 result.
z = v.
z - (2.0f*normal.
z)*dotProduct;
783 result.
x = fminf(v1.
x, v2.
x);
784 result.
y = fminf(v1.
y, v2.
y);
785 result.
z = fminf(v1.
z, v2.
z);
795 result.
x = fmaxf(v1.
x, v2.
x);
796 result.
y = fmaxf(v1.
y, v2.
y);
797 result.
z = fmaxf(v1.
z, v2.
z);
811 float d00 = (v0.
x*v0.
x + v0.
y*v0.
y + v0.
z*v0.
z);
812 float d01 = (v0.
x*v1.
x + v0.
y*v1.
y + v0.
z*v1.
z);
813 float d11 = (v1.
x*v1.
x + v1.
y*v1.
y + v1.
z*v1.
z);
814 float d20 = (v2.
x*v0.
x + v2.
y*v0.
y + v2.
z*v0.
z);
815 float d21 = (v2.
x*v1.
x + v2.
y*v1.
y + v2.
z*v1.
z);
817 float denom = d00*d11 - d01*d01;
819 result.
y = (d11*d20 - d01*d21)/denom;
820 result.
z = (d00*d21 - d01*d20)/denom;
821 result.
x = 1.0f - (result.
z + result.
y);
834 view.
m0*projection.
m0 + view.
m1*projection.
m4 + view.
m2*projection.
m8 + view.
m3*projection.
m12,
835 view.
m0*projection.
m1 + view.
m1*projection.
m5 + view.
m2*projection.
m9 + view.
m3*projection.
m13,
836 view.
m0*projection.
m2 + view.
m1*projection.
m6 + view.
m2*projection.
m10 + view.
m3*projection.
m14,
837 view.
m0*projection.
m3 + view.
m1*projection.
m7 + view.
m2*projection.
m11 + view.
m3*projection.
m15,
838 view.
m4*projection.
m0 + view.
m5*projection.
m4 + view.
m6*projection.
m8 + view.
m7*projection.
m12,
839 view.
m4*projection.
m1 + view.
m5*projection.
m5 + view.
m6*projection.
m9 + view.
m7*projection.
m13,
840 view.
m4*projection.
m2 + view.
m5*projection.
m6 + view.
m6*projection.
m10 + view.
m7*projection.
m14,
841 view.
m4*projection.
m3 + view.
m5*projection.
m7 + view.
m6*projection.
m11 + view.
m7*projection.
m15,
842 view.
m8*projection.
m0 + view.
m9*projection.
m4 + view.
m10*projection.
m8 + view.
m11*projection.
m12,
843 view.
m8*projection.
m1 + view.
m9*projection.
m5 + view.
m10*projection.
m9 + view.
m11*projection.
m13,
844 view.
m8*projection.
m2 + view.
m9*projection.
m6 + view.
m10*projection.
m10 + view.
m11*projection.
m14,
845 view.
m8*projection.
m3 + view.
m9*projection.
m7 + view.
m10*projection.
m11 + view.
m11*projection.
m15,
853 float a00 = matViewProj.
m0, a01 = matViewProj.
m1, a02 = matViewProj.
m2, a03 = matViewProj.
m3;
854 float a10 = matViewProj.
m4, a11 = matViewProj.
m5, a12 = matViewProj.
m6, a13 = matViewProj.
m7;
855 float a20 = matViewProj.
m8, a21 = matViewProj.
m9, a22 = matViewProj.
m10, a23 = matViewProj.
m11;
856 float a30 = matViewProj.
m12, a31 = matViewProj.
m13, a32 = matViewProj.
m14, a33 = matViewProj.
m15;
858 float b00 = a00*a11 - a01*a10;
859 float b01 = a00*a12 - a02*a10;
860 float b02 = a00*a13 - a03*a10;
861 float b03 = a01*a12 - a02*a11;
862 float b04 = a01*a13 - a03*a11;
863 float b05 = a02*a13 - a03*a12;
864 float b06 = a20*a31 - a21*a30;
865 float b07 = a20*a32 - a22*a30;
866 float b08 = a20*a33 - a23*a30;
867 float b09 = a21*a32 - a22*a31;
868 float b10 = a21*a33 - a23*a31;
869 float b11 = a22*a33 - a23*a32;
872 float invDet = 1.0f/(b00*b11 - b01*b10 + b02*b09 + b03*b08 - b04*b07 + b05*b06);
875 (a11*b11 - a12*b10 + a13*b09)*invDet,
876 (-a01*b11 + a02*b10 - a03*b09)*invDet,
877 (a31*b05 - a32*b04 + a33*b03)*invDet,
878 (-a21*b05 + a22*b04 - a23*b03)*invDet,
879 (-a10*b11 + a12*b08 - a13*b07)*invDet,
880 (a00*b11 - a02*b08 + a03*b07)*invDet,
881 (-a30*b05 + a32*b02 - a33*b01)*invDet,
882 (a20*b05 - a22*b02 + a23*b01)*invDet,
883 (a10*b10 - a11*b08 + a13*b06)*invDet,
884 (-a00*b10 + a01*b08 - a03*b06)*invDet,
885 (a30*b04 - a31*b02 + a33*b00)*invDet,
886 (-a20*b04 + a21*b02 - a23*b00)*invDet,
887 (-a10*b09 + a11*b07 - a12*b06)*invDet,
888 (a00*b09 - a01*b07 + a02*b06)*invDet,
889 (-a30*b03 + a31*b01 - a32*b00)*invDet,
890 (a20*b03 - a21*b01 + a22*b00)*invDet };
897 matViewProjInv.
m0*quat.
x + matViewProjInv.
m4*quat.
y + matViewProjInv.
m8*quat.
z + matViewProjInv.
m12*quat.
w,
898 matViewProjInv.
m1*quat.
x + matViewProjInv.
m5*quat.
y + matViewProjInv.
m9*quat.
z + matViewProjInv.
m13*quat.
w,
899 matViewProjInv.
m2*quat.
x + matViewProjInv.
m6*quat.
y + matViewProjInv.
m10*quat.
z + matViewProjInv.
m14*quat.
w,
900 matViewProjInv.
m3*quat.
x + matViewProjInv.
m7*quat.
y + matViewProjInv.
m11*quat.
z + matViewProjInv.
m15*quat.
w };
903 result.
x = qtransformed.
x/qtransformed.
w;
904 result.
y = qtransformed.
y/qtransformed.
w;
905 result.
z = qtransformed.
z/qtransformed.
w;
925 Vector3 result = { 1.0f/v.
x, 1.0f/v.
y, 1.0f/v.
z };
936 result.
x = fminf(max.
x, fmaxf(min.
x, v.
x));
937 result.
y = fminf(max.
y, fmaxf(min.
y, v.
y));
938 result.
z = fminf(max.
z, fmaxf(min.
z, v.
z));
948 float length = (v.
x*v.
x) + (v.
y*v.
y) + (v.
z*v.
z);
951 length = sqrtf(length);
955 float scale = min/length;
956 result.
x = v.
x*scale;
957 result.
y = v.
y*scale;
958 result.
z = v.
z*scale;
960 else if (length > max)
962 float scale = max/length;
963 result.
x = v.
x*scale;
964 result.
y = v.
y*scale;
965 result.
z = v.
z*scale;
975 int result = ((fabsf(p.
x - q.
x)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
x), fabsf(q.
x))))) &&
976 ((fabsf(p.
y - q.
y)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
y), fabsf(q.
y))))) &&
977 ((fabsf(p.
z - q.
z)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
z), fabsf(q.
z)))));
992 float dot = v.
x*n.
x + v.
y*n.
y + v.
z*n.
z;
993 float d = 1.0f - r*r*(1.0f - dot*dot);
998 v.
x = r*v.
x - (r*dot + d)*n.
x;
999 v.
y = r*v.
y - (r*dot + d)*n.
y;
1000 v.
z = r*v.
z - (r*dot + d)*n.
z;
1015 float result = 0.0f;
1018 float a00 = mat.
m0, a01 = mat.
m1, a02 = mat.
m2, a03 = mat.
m3;
1019 float a10 = mat.
m4, a11 = mat.
m5, a12 = mat.
m6, a13 = mat.
m7;
1020 float a20 = mat.
m8, a21 = mat.
m9, a22 = mat.
m10, a23 = mat.
m11;
1021 float a30 = mat.
m12, a31 = mat.
m13, a32 = mat.
m14, a33 = mat.
m15;
1023 result = a30*a21*a12*a03 - a20*a31*a12*a03 - a30*a11*a22*a03 + a10*a31*a22*a03 +
1024 a20*a11*a32*a03 - a10*a21*a32*a03 - a30*a21*a02*a13 + a20*a31*a02*a13 +
1025 a30*a01*a22*a13 - a00*a31*a22*a13 - a20*a01*a32*a13 + a00*a21*a32*a13 +
1026 a30*a11*a02*a23 - a10*a31*a02*a23 - a30*a01*a12*a23 + a00*a31*a12*a23 +
1027 a10*a01*a32*a23 - a00*a11*a32*a23 - a20*a11*a02*a33 + a10*a21*a02*a33 +
1028 a20*a01*a12*a33 - a00*a21*a12*a33 - a10*a01*a22*a33 + a00*a11*a22*a33;
1036 float result = (mat.
m0 + mat.
m5 + mat.
m10 + mat.
m15);
1049 result.
m3 = mat.
m12;
1053 result.
m7 = mat.
m13;
1058 result.
m12 = mat.
m3;
1059 result.
m13 = mat.
m7;
1072 float a00 = mat.
m0, a01 = mat.
m1, a02 = mat.
m2, a03 = mat.
m3;
1073 float a10 = mat.
m4, a11 = mat.
m5, a12 = mat.
m6, a13 = mat.
m7;
1074 float a20 = mat.
m8, a21 = mat.
m9, a22 = mat.
m10, a23 = mat.
m11;
1075 float a30 = mat.
m12, a31 = mat.
m13, a32 = mat.
m14, a33 = mat.
m15;
1077 float b00 = a00*a11 - a01*a10;
1078 float b01 = a00*a12 - a02*a10;
1079 float b02 = a00*a13 - a03*a10;
1080 float b03 = a01*a12 - a02*a11;
1081 float b04 = a01*a13 - a03*a11;
1082 float b05 = a02*a13 - a03*a12;
1083 float b06 = a20*a31 - a21*a30;
1084 float b07 = a20*a32 - a22*a30;
1085 float b08 = a20*a33 - a23*a30;
1086 float b09 = a21*a32 - a22*a31;
1087 float b10 = a21*a33 - a23*a31;
1088 float b11 = a22*a33 - a23*a32;
1091 float invDet = 1.0f/(b00*b11 - b01*b10 + b02*b09 + b03*b08 - b04*b07 + b05*b06);
1093 result.
m0 = (a11*b11 - a12*b10 + a13*b09)*invDet;
1094 result.
m1 = (-a01*b11 + a02*b10 - a03*b09)*invDet;
1095 result.
m2 = (a31*b05 - a32*b04 + a33*b03)*invDet;
1096 result.
m3 = (-a21*b05 + a22*b04 - a23*b03)*invDet;
1097 result.
m4 = (-a10*b11 + a12*b08 - a13*b07)*invDet;
1098 result.
m5 = (a00*b11 - a02*b08 + a03*b07)*invDet;
1099 result.
m6 = (-a30*b05 + a32*b02 - a33*b01)*invDet;
1100 result.
m7 = (a20*b05 - a22*b02 + a23*b01)*invDet;
1101 result.
m8 = (a10*b10 - a11*b08 + a13*b06)*invDet;
1102 result.
m9 = (-a00*b10 + a01*b08 - a03*b06)*invDet;
1103 result.
m10 = (a30*b04 - a31*b02 + a33*b00)*invDet;
1104 result.
m11 = (-a20*b04 + a21*b02 - a23*b00)*invDet;
1105 result.
m12 = (-a10*b09 + a11*b07 - a12*b06)*invDet;
1106 result.
m13 = (a00*b09 - a01*b07 + a02*b06)*invDet;
1107 result.
m14 = (-a30*b03 + a31*b01 - a32*b00)*invDet;
1108 result.
m15 = (a20*b03 - a21*b01 + a22*b00)*invDet;
1116 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1117 0.0f, 1.0f, 0.0f, 0.0f,
1118 0.0f, 0.0f, 1.0f, 0.0f,
1119 0.0f, 0.0f, 0.0f, 1.0f };
1129 result.
m0 = left.
m0 + right.
m0;
1130 result.
m1 = left.
m1 + right.
m1;
1131 result.
m2 = left.
m2 + right.
m2;
1132 result.
m3 = left.
m3 + right.
m3;
1133 result.
m4 = left.
m4 + right.
m4;
1134 result.
m5 = left.
m5 + right.
m5;
1135 result.
m6 = left.
m6 + right.
m6;
1136 result.
m7 = left.
m7 + right.
m7;
1137 result.
m8 = left.
m8 + right.
m8;
1138 result.
m9 = left.
m9 + right.
m9;
1154 result.
m0 = left.
m0 - right.
m0;
1155 result.
m1 = left.
m1 - right.
m1;
1156 result.
m2 = left.
m2 - right.
m2;
1157 result.
m3 = left.
m3 - right.
m3;
1158 result.
m4 = left.
m4 - right.
m4;
1159 result.
m5 = left.
m5 - right.
m5;
1160 result.
m6 = left.
m6 - right.
m6;
1161 result.
m7 = left.
m7 - right.
m7;
1162 result.
m8 = left.
m8 - right.
m8;
1163 result.
m9 = left.
m9 - right.
m9;
1203 Matrix result = { 1.0f, 0.0f, 0.0f, x,
1204 0.0f, 1.0f, 0.0f, y,
1205 0.0f, 0.0f, 1.0f, z,
1206 0.0f, 0.0f, 0.0f, 1.0f };
1217 float x = axis.
x, y = axis.
y, z = axis.
z;
1219 float lengthSquared = x*x + y*y + z*z;
1221 if ((lengthSquared != 1.0f) && (lengthSquared != 0.0f))
1223 float ilength = 1.0f/sqrtf(lengthSquared);
1229 float sinres = sinf(angle);
1230 float cosres = cosf(angle);
1231 float t = 1.0f - cosres;
1233 result.
m0 = x*x*t + cosres;
1234 result.
m1 = y*x*t + z*sinres;
1235 result.
m2 = z*x*t - y*sinres;
1238 result.
m4 = x*y*t - z*sinres;
1239 result.
m5 = y*y*t + cosres;
1240 result.
m6 = z*y*t + x*sinres;
1243 result.
m8 = x*z*t + y*sinres;
1244 result.
m9 = y*z*t - x*sinres;
1245 result.
m10 = z*z*t + cosres;
1259 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1260 0.0f, 1.0f, 0.0f, 0.0f,
1261 0.0f, 0.0f, 1.0f, 0.0f,
1262 0.0f, 0.0f, 0.0f, 1.0f };
1264 float cosres = cosf(angle);
1265 float sinres = sinf(angle);
1268 result.
m6 = -sinres;
1270 result.
m10 = cosres;
1278 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1279 0.0f, 1.0f, 0.0f, 0.0f,
1280 0.0f, 0.0f, 1.0f, 0.0f,
1281 0.0f, 0.0f, 0.0f, 1.0f };
1283 float cosres = cosf(angle);
1284 float sinres = sinf(angle);
1288 result.
m8 = -sinres;
1289 result.
m10 = cosres;
1297 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1298 0.0f, 1.0f, 0.0f, 0.0f,
1299 0.0f, 0.0f, 1.0f, 0.0f,
1300 0.0f, 0.0f, 0.0f, 1.0f };
1302 float cosres = cosf(angle);
1303 float sinres = sinf(angle);
1306 result.
m1 = -sinres;
1317 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1318 0.0f, 1.0f, 0.0f, 0.0f,
1319 0.0f, 0.0f, 1.0f, 0.0f,
1320 0.0f, 0.0f, 0.0f, 1.0f };
1322 float cosz = cosf(-ang.
z);
1323 float sinz = sinf(-ang.
z);
1324 float cosy = cosf(-ang.
y);
1325 float siny = sinf(-ang.
y);
1326 float cosx = cosf(-ang.
x);
1327 float sinx = sinf(-ang.
x);
1329 result.
m0 = cosz*cosy;
1330 result.
m4 = (cosz*siny*sinx) - (sinz*cosx);
1331 result.
m8 = (cosz*siny*cosx) + (sinz*sinx);
1333 result.
m1 = sinz*cosy;
1334 result.
m5 = (sinz*siny*sinx) + (cosz*cosx);
1335 result.
m9 = (sinz*siny*cosx) - (cosz*sinx);
1338 result.
m6 = cosy*sinx;
1339 result.
m10= cosy*cosx;
1349 float cz = cosf(ang.
z);
1350 float sz = sinf(ang.
z);
1351 float cy = cosf(ang.
y);
1352 float sy = sinf(ang.
y);
1353 float cx = cosf(ang.
x);
1354 float sx = sinf(ang.
x);
1357 result.
m1 = cz*sy*sx - cx*sz;
1358 result.
m2 = sz*sx + cz*cx*sy;
1362 result.
m5 = cz*cx + sz*sy*sx;
1363 result.
m6 = cx*sz*sy - cz*sx;
1382 Matrix result = { x, 0.0f, 0.0f, 0.0f,
1383 0.0f, y, 0.0f, 0.0f,
1384 0.0f, 0.0f, z, 0.0f,
1385 0.0f, 0.0f, 0.0f, 1.0f };
1395 float rl = (float)(right - left);
1396 float tb = (float)(top - bottom);
1397 float fn = (float)(far - near);
1399 result.
m0 = ((float)near*2.0f)/rl;
1405 result.
m5 = ((float)near*2.0f)/tb;
1409 result.
m8 = ((float)right + (
float)left)/rl;
1410 result.
m9 = ((float)top + (
float)bottom)/tb;
1411 result.
m10 = -((float)far + (
float)near)/fn;
1416 result.
m14 = -((float)far*(
float)near*2.0f)/fn;
1428 double top = near*tan(fovy*0.5);
1429 double bottom = -top;
1430 double right = top*aspect;
1431 double left = -right;
1434 float rl = (float)(right - left);
1435 float tb = (float)(top - bottom);
1436 float fn = (float)(far - near);
1438 result.
m0 = ((float)near*2.0f)/rl;
1439 result.
m5 = ((float)near*2.0f)/tb;
1440 result.
m8 = ((float)right + (
float)left)/rl;
1441 result.
m9 = ((float)top + (
float)bottom)/tb;
1442 result.
m10 = -((float)far + (
float)near)/fn;
1444 result.
m14 = -((float)far*(
float)near*2.0f)/fn;
1454 float rl = (float)(right - left);
1455 float tb = (float)(top - bottom);
1456 float fn = (float)(far - near);
1458 result.
m0 = 2.0f/rl;
1463 result.
m5 = 2.0f/tb;
1468 result.
m10 = -2.0f/fn;
1470 result.
m12 = -((float)left + (
float)right)/rl;
1471 result.
m13 = -((float)top + (
float)bottom)/tb;
1472 result.
m14 = -((float)far + (
float)near)/fn;
1483 float length = 0.0f;
1484 float ilength = 0.0f;
1487 Vector3 vz = { eye.
x - target.
x, eye.
y - target.
y, eye.
z - target.
z };
1491 length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
1492 if (length == 0.0f) length = 1.0f;
1493 ilength = 1.0f/length;
1503 length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
1504 if (length == 0.0f) length = 1.0f;
1505 ilength = 1.0f/length;
1525 result.
m12 = -(vx.
x*eye.
x + vx.
y*eye.
y + vx.
z*eye.
z);
1526 result.
m13 = -(vy.
x*eye.
x + vy.
y*eye.
y + vy.
z*eye.
z);
1527 result.
m14 = -(vz.
x*eye.
x + vz.
y*eye.
y + vz.
z*eye.
z);
1538 result.
v[0] = mat.
m0;
1539 result.
v[1] = mat.
m1;
1540 result.
v[2] = mat.
m2;
1541 result.
v[3] = mat.
m3;
1542 result.
v[4] = mat.
m4;
1543 result.
v[5] = mat.
m5;
1544 result.
v[6] = mat.
m6;
1545 result.
v[7] = mat.
m7;
1546 result.
v[8] = mat.
m8;
1547 result.
v[9] = mat.
m9;
1548 result.
v[10] = mat.
m10;
1549 result.
v[11] = mat.
m11;
1550 result.
v[12] = mat.
m12;
1551 result.
v[13] = mat.
m13;
1552 result.
v[14] = mat.
m14;
1553 result.
v[15] = mat.
m15;
1573 Quaternion result = {q.
x + add, q.
y + add, q.
z + add, q.
w + add};
1589 Quaternion result = {q.
x - sub, q.
y - sub, q.
z - sub, q.
w - sub};
1597 Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f };
1605 float result = sqrtf(q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w);
1615 float length = sqrtf(q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w);
1616 if (length == 0.0f) length = 1.0f;
1617 float ilength = 1.0f/length;
1619 result.
x = q.
x*ilength;
1620 result.
y = q.
y*ilength;
1621 result.
z = q.
z*ilength;
1622 result.
w = q.
w*ilength;
1632 float lengthSq = q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w;
1634 if (lengthSq != 0.0f)
1636 float invLength = 1.0f/lengthSq;
1638 result.
x *= -invLength;
1639 result.
y *= -invLength;
1640 result.
z *= -invLength;
1641 result.
w *= invLength;
1652 float qax = q1.
x, qay = q1.
y, qaz = q1.
z, qaw = q1.
w;
1653 float qbx = q2.
x, qby = q2.
y, qbz = q2.
z, qbw = q2.
w;
1655 result.
x = qax*qbw + qaw*qbx + qay*qbz - qaz*qby;
1656 result.
y = qay*qbw + qaw*qby + qaz*qbx - qax*qbz;
1657 result.
z = qaz*qbw + qaw*qbz + qax*qby - qay*qbx;
1658 result.
w = qaw*qbw - qax*qbx - qay*qby - qaz*qbz;
1689 result.
x = q1.
x + amount*(q2.
x - q1.
x);
1690 result.
y = q1.
y + amount*(q2.
y - q1.
y);
1691 result.
z = q1.
z + amount*(q2.
z - q1.
z);
1692 result.
w = q1.
w + amount*(q2.
w - q1.
w);
1703 result.
x = q1.
x + amount*(q2.
x - q1.
x);
1704 result.
y = q1.
y + amount*(q2.
y - q1.
y);
1705 result.
z = q1.
z + amount*(q2.
z - q1.
z);
1706 result.
w = q1.
w + amount*(q2.
w - q1.
w);
1710 float length = sqrtf(q.x*q.x + q.y*q.y + q.z*q.z + q.w*q.w);
1711 if (length == 0.0f) length = 1.0f;
1712 float ilength = 1.0f/length;
1714 result.
x = q.x*ilength;
1715 result.
y = q.y*ilength;
1716 result.
z = q.z*ilength;
1717 result.
w = q.w*ilength;
1727 float cosHalfTheta = q1.
x*q2.
x + q1.
y*q2.
y + q1.
z*q2.
z + q1.
w*q2.
w;
1729 if (cosHalfTheta < 0)
1731 q2.
x = -q2.
x; q2.
y = -q2.
y; q2.
z = -q2.
z; q2.
w = -q2.
w;
1732 cosHalfTheta = -cosHalfTheta;
1735 if (fabsf(cosHalfTheta) >= 1.0f) result = q1;
1736 else if (cosHalfTheta > 0.95f) result =
QuaternionNlerp(q1, q2, amount);
1739 float halfTheta = acosf(cosHalfTheta);
1740 float sinHalfTheta = sqrtf(1.0f - cosHalfTheta*cosHalfTheta);
1742 if (fabsf(sinHalfTheta) < 0.001f)
1744 result.
x = (q1.
x*0.5f + q2.
x*0.5f);
1745 result.
y = (q1.
y*0.5f + q2.
y*0.5f);
1746 result.
z = (q1.
z*0.5f + q2.
z*0.5f);
1747 result.
w = (q1.
w*0.5f + q2.
w*0.5f);
1751 float ratioA = sinf((1 - amount)*halfTheta)/sinHalfTheta;
1752 float ratioB = sinf(amount*halfTheta)/sinHalfTheta;
1754 result.
x = (q1.
x*ratioA + q2.
x*ratioB);
1755 result.
y = (q1.
y*ratioA + q2.
y*ratioB);
1756 result.
z = (q1.
z*ratioA + q2.
z*ratioB);
1757 result.
w = (q1.
w*ratioA + q2.
w*ratioB);
1769 float cos2Theta = (from.
x*to.
x + from.
y*to.
y + from.
z*to.
z);
1770 Vector3 cross = { from.
y*to.
z - from.
z*to.
y, from.
z*to.
x - from.
x*to.
z, from.
x*to.
y - from.
y*to.
x };
1775 result.
w = 1.0f + cos2Theta;
1780 float length = sqrtf(q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w);
1781 if (length == 0.0f) length = 1.0f;
1782 float ilength = 1.0f/length;
1784 result.
x = q.
x*ilength;
1785 result.
y = q.
y*ilength;
1786 result.
z = q.
z*ilength;
1787 result.
w = q.
w*ilength;
1797 if ((mat.
m0 > mat.
m5) && (mat.
m0 > mat.
m10))
1799 float s = sqrtf(1.0f + mat.
m0 - mat.
m5 - mat.
m10)*2;
1802 result.
y = (mat.
m4 + mat.
m1)/s;
1803 result.
z = (mat.
m2 + mat.
m8)/s;
1804 result.
w = (mat.
m9 - mat.
m6)/s;
1806 else if (mat.
m5 > mat.
m10)
1808 float s = sqrtf(1.0f + mat.
m5 - mat.
m0 - mat.
m10)*2;
1809 result.
x = (mat.
m4 + mat.
m1)/s;
1811 result.
z = (mat.
m9 + mat.
m6)/s;
1812 result.
w = (mat.
m2 - mat.
m8)/s;
1816 float s = sqrtf(1.0f + mat.
m10 - mat.
m0 - mat.
m5)*2;
1817 result.
x = (mat.
m2 + mat.
m8)/s;
1818 result.
y = (mat.
m9 + mat.
m6)/s;
1820 result.
w = (mat.
m4 - mat.
m1)/s;
1829 Matrix result = { 1.0f, 0.0f, 0.0f, 0.0f,
1830 0.0f, 1.0f, 0.0f, 0.0f,
1831 0.0f, 0.0f, 1.0f, 0.0f,
1832 0.0f, 0.0f, 0.0f, 1.0f };
1844 result.
m0 = 1 - 2*(b2 + c2);
1845 result.
m1 = 2*(ab + cd);
1846 result.
m2 = 2*(ac - bd);
1848 result.
m4 = 2*(ab - cd);
1849 result.
m5 = 1 - 2*(a2 + c2);
1850 result.
m6 = 2*(bc + ad);
1852 result.
m8 = 2*(ac + bd);
1853 result.
m9 = 2*(bc - ad);
1854 result.
m10 = 1 - 2*(a2 + b2);
1863 Quaternion result = { 0.0f, 0.0f, 0.0f, 1.0f };
1865 float axisLength = sqrtf(axis.
x*axis.
x + axis.
y*axis.
y + axis.
z*axis.
z);
1867 if (axisLength != 0.0f)
1871 float length = 0.0f;
1872 float ilength = 0.0f;
1876 length = sqrtf(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z);
1877 if (length == 0.0f) length = 1.0f;
1878 ilength = 1.0f/length;
1883 float sinres = sinf(angle);
1884 float cosres = cosf(angle);
1886 result.
x = axis.
x*sinres;
1887 result.
y = axis.
y*sinres;
1888 result.
z = axis.
z*sinres;
1893 length = sqrtf(q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w);
1894 if (length == 0.0f) length = 1.0f;
1895 ilength = 1.0f/length;
1896 result.
x = q.
x*ilength;
1897 result.
y = q.
y*ilength;
1898 result.
z = q.
z*ilength;
1899 result.
w = q.
w*ilength;
1908 if (fabsf(q.
w) > 1.0f)
1911 float length = sqrtf(q.
x*q.
x + q.
y*q.
y + q.
z*q.
z + q.
w*q.
w);
1912 if (length == 0.0f) length = 1.0f;
1913 float ilength = 1.0f/length;
1921 Vector3 resAxis = { 0.0f, 0.0f, 0.0f };
1922 float resAngle = 2.0f*acosf(q.
w);
1923 float den = sqrtf(1.0f - q.
w*q.
w);
1927 resAxis.
x = q.
x/den;
1928 resAxis.
y = q.
y/den;
1929 resAxis.
z = q.
z/den;
1939 *outAngle = resAngle;
1948 float x0 = cosf(pitch*0.5f);
1949 float x1 = sinf(pitch*0.5f);
1950 float y0 = cosf(yaw*0.5f);
1951 float y1 = sinf(yaw*0.5f);
1952 float z0 = cosf(roll*0.5f);
1953 float z1 = sinf(roll*0.5f);
1955 result.
x = x1*y0*z0 - x0*y1*z1;
1956 result.
y = x0*y1*z0 + x1*y0*z1;
1957 result.
z = x0*y0*z1 - x1*y1*z0;
1958 result.
w = x0*y0*z0 + x1*y1*z1;
1970 float x0 = 2.0f*(q.
w*q.
x + q.
y*q.
z);
1971 float x1 = 1.0f - 2.0f*(q.
x*q.
x + q.
y*q.
y);
1972 result.
x = atan2f(x0, x1);
1975 float y0 = 2.0f*(q.
w*q.
y - q.
z*q.
x);
1976 y0 = y0 > 1.0f ? 1.0f : y0;
1977 y0 = y0 < -1.0f ? -1.0f : y0;
1978 result.
y = asinf(y0);
1981 float z0 = 2.0f*(q.
w*q.
z + q.
x*q.
y);
1982 float z1 = 1.0f - 2.0f*(q.
y*q.
y + q.
z*q.
z);
1983 result.
z = atan2f(z0, z1);
2004 int result = ((fabsf(p.
x - q.
x)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
x), fabsf(q.
x))))) &&
2005 ((fabsf(p.
y - q.
y)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
y), fabsf(q.
y))))) &&
2006 ((fabsf(p.
z - q.
z)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
z), fabsf(q.
z))))) &&
2007 ((fabsf(p.
w - q.
w)) <= (
EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.
w), fabsf(q.
w)))));
RMAPI Vector2 Vector2ClampValue(Vector2 v, float min, float max)
RMAPI float Clamp(float value, float min, float max)
RMAPI Vector3 Vector3Normalize(Vector3 v)
RMAPI float QuaternionLength(Quaternion q)
RMAPI Vector2 Vector2Transform(Vector2 v, Matrix mat)
RMAPI Vector2 Vector2Negate(Vector2 v)
RMAPI Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max)
RMAPI Vector3 Vector3Transform(Vector3 v, Matrix mat)
#define RMAPI
raymath v1.5 - Math functions to work with Vector2, Vector3, Matrix and Quaternions
RMAPI Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q)
RMAPI Vector2 Vector2Zero(void)
RMAPI Matrix MatrixRotate(Vector3 axis, float angle)
RMAPI Vector2 Vector2One(void)
RMAPI float Vector2LengthSqr(Vector2 v)
RMAPI Vector2 Vector2Multiply(Vector2 v1, Vector2 v2)
RMAPI Quaternion QuaternionNormalize(Quaternion q)
RMAPI Quaternion QuaternionFromEuler(float pitch, float yaw, float roll)
RMAPI Vector2 Vector2Invert(Vector2 v)
RMAPI Quaternion QuaternionIdentity(void)
RMAPI Quaternion QuaternionInvert(Quaternion q)
RMAPI Vector3 Vector3AddValue(Vector3 v, float add)
RMAPI Quaternion QuaternionFromMatrix(Matrix mat)
RMAPI float Vector3Angle(Vector3 v1, Vector3 v2)
RMAPI Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount)
RMAPI Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to)
RMAPI Matrix QuaternionToMatrix(Quaternion q)
RMAPI Vector3 Vector3Min(Vector3 v1, Vector3 v2)
RMAPI Vector2 Vector2Divide(Vector2 v1, Vector2 v2)
RMAPI Vector3 Vector3Perpendicular(Vector3 v)
RMAPI Vector2 Vector2AddValue(Vector2 v, float add)
RMAPI Quaternion QuaternionScale(Quaternion q, float mul)
RMAPI int FloatEquals(float x, float y)
RMAPI float Vector3LengthSqr(const Vector3 v)
RMAPI float Vector3DotProduct(Vector3 v1, Vector3 v2)
RMAPI Matrix MatrixScale(float x, float y, float z)
RMAPI Vector2 Vector2Rotate(Vector2 v, float angle)
RMAPI Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c)
RMAPI Vector3 Vector3Add(Vector3 v1, Vector3 v2)
RMAPI float Normalize(float value, float start, float end)
RMAPI Vector3 Vector3One(void)
RMAPI Vector2 Vector2Reflect(Vector2 v, Vector2 normal)
RMAPI Vector2 Vector2Add(Vector2 v1, Vector2 v2)
RMAPI Matrix MatrixIdentity(void)
RMAPI Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance)
RMAPI Matrix MatrixRotateX(float angle)
RMAPI Vector3 Vector3Zero(void)
RMAPI Vector3 Vector3Subtract(Vector3 v1, Vector3 v2)
RMAPI Vector2 Vector2Scale(Vector2 v, float scale)
RMAPI Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2)
RMAPI float Vector2DotProduct(Vector2 v1, Vector2 v2)
RMAPI float Vector3DistanceSqr(Vector3 v1, Vector3 v2)
RMAPI int Vector3Equals(Vector3 p, Vector3 q)
RMAPI Vector2 Vector2Normalize(Vector2 v)
RMAPI Quaternion QuaternionDivide(Quaternion q1, Quaternion q2)
RMAPI Quaternion QuaternionAdd(Quaternion q1, Quaternion q2)
RMAPI float Vector2Length(Vector2 v)
RMAPI Matrix MatrixTranslate(float x, float y, float z)
RMAPI Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view)
RMAPI Vector3 Vector3Multiply(Vector3 v1, Vector3 v2)
RMAPI int QuaternionEquals(Quaternion p, Quaternion q)
RMAPI float16 MatrixToFloatV(Matrix mat)
RMAPI Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max)
RMAPI Vector3 Vector3Negate(Vector3 v)
RMAPI Vector3 Vector3Divide(Vector3 v1, Vector3 v2)
RMAPI float Vector3Distance(Vector3 v1, Vector3 v2)
RMAPI float MatrixDeterminant(Matrix mat)
RMAPI float3 Vector3ToFloatV(Vector3 v)
RMAPI Quaternion QuaternionTransform(Quaternion q, Matrix mat)
RMAPI Matrix MatrixPerspective(double fovy, double aspect, double near, double far)
RMAPI Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount)
RMAPI Matrix MatrixInvert(Matrix mat)
RMAPI Matrix MatrixSubtract(Matrix left, Matrix right)
RMAPI float Lerp(float start, float end, float amount)
RMAPI Vector3 Vector3SubtractValue(Vector3 v, float sub)
RMAPI Matrix MatrixRotateZYX(Vector3 ang)
RMAPI float Vector2DistanceSqr(Vector2 v1, Vector2 v2)
RMAPI Vector2 Vector2SubtractValue(Vector2 v, float sub)
RMAPI Vector2 Vector2Subtract(Vector2 v1, Vector2 v2)
RMAPI Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
RMAPI Vector3 Vector3ClampValue(Vector3 v, float min, float max)
RMAPI Vector3 Vector3Refract(Vector3 v, Vector3 n, float r)
RMAPI Matrix MatrixRotateXYZ(Vector3 ang)
RMAPI Vector3 Vector3Reflect(Vector3 v, Vector3 normal)
RMAPI Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
RMAPI float Vector2Distance(Vector2 v1, Vector2 v2)
RMAPI void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2)
RMAPI Vector3 QuaternionToEuler(Quaternion q)
RMAPI float MatrixTrace(Matrix mat)
RMAPI float Vector3Length(const Vector3 v)
RMAPI Matrix MatrixAdd(Matrix left, Matrix right)
RMAPI Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2)
RMAPI Quaternion QuaternionAddValue(Quaternion q, float add)
RMAPI Matrix MatrixRotateY(float angle)
RMAPI void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle)
RMAPI Vector3 Vector3Max(Vector3 v1, Vector3 v2)
RMAPI Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2)
RMAPI Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount)
RMAPI Matrix MatrixRotateZ(float angle)
RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far)
RMAPI Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount)
RMAPI Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far)
RMAPI Quaternion QuaternionSubtractValue(Quaternion q, float sub)
RMAPI int Vector2Equals(Vector2 p, Vector2 q)
RMAPI float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd)
RMAPI Vector3 Vector3Invert(Vector3 v)
RMAPI Vector3 Vector3Scale(Vector3 v, float scalar)
RMAPI Matrix MatrixTranspose(Matrix mat)
RMAPI Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up)
RMAPI float Vector2Angle(Vector2 v1, Vector2 v2)
RMAPI Matrix MatrixMultiply(Matrix left, Matrix right)