From 049f09f3d404385c8e0a5470d823b8b7cfde529e Mon Sep 17 00:00:00 2001 From: Andrey Pokidov Date: Wed, 13 Nov 2024 12:41:05 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BC=D0=B0=D1=82=D1=80=D0=B8=D1=86=D1=8B=202x3?= =?UTF-8?q?=20=D0=B8=203x2,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B8=D0=B7=D0=B2=D0=B5=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BC=D0=B0=D1=82=D1=80=D0=B8=D1=86?= =?UTF-8?q?.=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B2=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=D1=85?= =?UTF-8?q?=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Geometry.workspace.layout | 3 +- GeometryC.sln | 102 ++++----- dev/geometry-dev.layout | 4 +- dev/geometry-dev.vcxproj | 328 +++++++++++++-------------- dev/geometry-dev.vcxproj.filters | 42 ++-- dev/geometry-dev.vcxproj.user | 6 +- dev/main.c | 17 +- docs/documentation.odt | Bin 0 -> 36177 bytes src/geometry.cbp | 6 + src/geometry.h | 38 ++-- src/geometry.layout | 130 ++++++----- src/geometry.vcxproj | 348 ++++++++++++++--------------- src/geometry.vcxproj.filters | 154 ++++++------- src/geometry.vcxproj.user | 6 +- src/matrix2x2.c | 25 +-- src/matrix2x2.h | 159 ++++--------- src/matrix2x3.h | 141 ++++++++++++ src/matrix3x2.h | 100 +++++++++ src/matrix3x3.c | 80 ------- src/matrix3x3.h | 61 ++--- src/matrixes.c | 257 +++++++++++++++++++++ src/matrixes.h | 144 ++++++++++++ src/quaternion.h | 64 ++++-- src/vector2.c | 146 ++++++------ src/vector2.h | 98 ++++---- src/vector3.c | 150 ++++++------- src/vector3.h | 114 +++++----- src/versor.h | 24 +- test/geometry-test.vcxproj | 322 +++++++++++++------------- test/geometry-test.vcxproj.filters | 70 +++--- test/geometry-test.vcxproj.user | 6 +- 31 files changed, 1831 insertions(+), 1314 deletions(-) create mode 100644 docs/documentation.odt create mode 100644 src/matrix2x3.h create mode 100644 src/matrix3x2.h create mode 100644 src/matrixes.c create mode 100644 src/matrixes.h diff --git a/Geometry.workspace.layout b/Geometry.workspace.layout index e46768a..1c395b7 100644 --- a/Geometry.workspace.layout +++ b/Geometry.workspace.layout @@ -1,5 +1,6 @@ - + + diff --git a/GeometryC.sln b/GeometryC.sln index aec3cde..7e0cf58 100644 --- a/GeometryC.sln +++ b/GeometryC.sln @@ -1,51 +1,51 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.32421.90 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry", "src\geometry.vcxproj", "{40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry-test", "test\geometry-test.vcxproj", "{48DAE315-715F-4044-ADF5-0308483B887C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry-dev", "dev\geometry-dev.vcxproj", "{46DE6C8F-3179-4652-95CF-28D44AC4774A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x64.ActiveCfg = Debug|x64 - {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x64.Build.0 = Debug|x64 - {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x86.ActiveCfg = Debug|Win32 - {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x86.Build.0 = Debug|Win32 - {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x64.ActiveCfg = Release|x64 - {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x64.Build.0 = Release|x64 - {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x86.ActiveCfg = Release|Win32 - {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x86.Build.0 = Release|Win32 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x64.ActiveCfg = Debug|x64 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x64.Build.0 = Debug|x64 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x86.ActiveCfg = Debug|Win32 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x86.Build.0 = Debug|Win32 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x64.ActiveCfg = Release|x64 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x64.Build.0 = Release|x64 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x86.ActiveCfg = Release|Win32 - {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x86.Build.0 = Release|Win32 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x64.ActiveCfg = Debug|x64 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x64.Build.0 = Debug|x64 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x86.ActiveCfg = Debug|Win32 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x86.Build.0 = Debug|Win32 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x64.ActiveCfg = Release|x64 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x64.Build.0 = Release|x64 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x86.ActiveCfg = Release|Win32 - {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {482D2212-4373-4231-88E5-34BD6B8CFF46} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32421.90 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry", "src\geometry.vcxproj", "{40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry-test", "test\geometry-test.vcxproj", "{48DAE315-715F-4044-ADF5-0308483B887C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "geometry-dev", "dev\geometry-dev.vcxproj", "{46DE6C8F-3179-4652-95CF-28D44AC4774A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x64.ActiveCfg = Debug|x64 + {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x64.Build.0 = Debug|x64 + {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x86.ActiveCfg = Debug|Win32 + {48DAE315-715F-4044-ADF5-0308483B887C}.Debug|x86.Build.0 = Debug|Win32 + {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x64.ActiveCfg = Release|x64 + {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x64.Build.0 = Release|x64 + {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x86.ActiveCfg = Release|Win32 + {48DAE315-715F-4044-ADF5-0308483B887C}.Release|x86.Build.0 = Release|Win32 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x64.ActiveCfg = Debug|x64 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x64.Build.0 = Debug|x64 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x86.ActiveCfg = Debug|Win32 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Debug|x86.Build.0 = Debug|Win32 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x64.ActiveCfg = Release|x64 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x64.Build.0 = Release|x64 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x86.ActiveCfg = Release|Win32 + {40CA6FB4-135F-4D54-A8D9-7338BA56E6A7}.Release|x86.Build.0 = Release|Win32 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x64.ActiveCfg = Debug|x64 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x64.Build.0 = Debug|x64 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x86.ActiveCfg = Debug|Win32 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Debug|x86.Build.0 = Debug|Win32 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x64.ActiveCfg = Release|x64 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x64.Build.0 = Release|x64 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x86.ActiveCfg = Release|Win32 + {46DE6C8F-3179-4652-95CF-28D44AC4774A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {482D2212-4373-4231-88E5-34BD6B8CFF46} + EndGlobalSection +EndGlobal diff --git a/dev/geometry-dev.layout b/dev/geometry-dev.layout index 39a63a4..e500d34 100644 --- a/dev/geometry-dev.layout +++ b/dev/geometry-dev.layout @@ -1,10 +1,10 @@ - + - + diff --git a/dev/geometry-dev.vcxproj b/dev/geometry-dev.vcxproj index b3c937c..7329822 100644 --- a/dev/geometry-dev.vcxproj +++ b/dev/geometry-dev.vcxproj @@ -1,165 +1,165 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} - - - - 16.0 - Win32Proj - {46de6c8f-3179-4652-95cf-28d44ac4774a} - geometry-dev - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - CompileAsC - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - CompileAsC - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - CompileAsC - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - CompileAsC - MaxSpeed - $(SolutionDir)src;%(AdditionalIncludeDirectories) - Neither - Sync - NotSet - Precise - - - Console - true - true - true - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} + + + + 16.0 + Win32Proj + {46de6c8f-3179-4652-95cf-28d44ac4774a} + geometry-dev + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + CompileAsC + MaxSpeed + $(SolutionDir)src;%(AdditionalIncludeDirectories) + Neither + Sync + NotSet + Precise + + + Console + true + true + true + + + + + \ No newline at end of file diff --git a/dev/geometry-dev.vcxproj.filters b/dev/geometry-dev.vcxproj.filters index 669bc4e..48814f7 100644 --- a/dev/geometry-dev.vcxproj.filters +++ b/dev/geometry-dev.vcxproj.filters @@ -1,22 +1,22 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + \ No newline at end of file diff --git a/dev/geometry-dev.vcxproj.user b/dev/geometry-dev.vcxproj.user index 88a5509..0f14913 100644 --- a/dev/geometry-dev.vcxproj.user +++ b/dev/geometry-dev.vcxproj.user @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/dev/main.c b/dev/main.c index 9db6f02..93cc706 100644 --- a/dev/main.c +++ b/dev/main.c @@ -135,7 +135,7 @@ void print_matrix(const DPMatrix3x3* matrix) printf("(%lf, %lf, %lf)\n", matrix->r2c1, matrix->r2c2, matrix->r2c3); printf("(%lf, %lf, %lf)\n\n", matrix->r3c1, matrix->r3c2, matrix->r3c3); } - +/* int main() { DPMatrix3x3 m1, m2, check; @@ -170,3 +170,18 @@ int main() return 0; } +*/ + +int main() +{ +SPVector2 vector; + +sp_vector2_set(0, 0, &vector); + +printf("SPVector2(%f, %f), module = %d\n", + vector.x1, + vector.x2, + sp_vector2_is_zero(&vector) +); + return 0; +} diff --git a/docs/documentation.odt b/docs/documentation.odt new file mode 100644 index 0000000000000000000000000000000000000000..a15f6fdd9a8c1fc03a81122a17bb76359d4d4fb6 GIT binary patch literal 36177 zcmdqIWmsj&lCX;x?(XjHP`JCh6z=ZsQnEyA|&4?(Te4pE)yqrhEGI%>8%w z^K4iwh>XaHmHB2wY~&tanvUa3(G;(#6`)x3AaPZ#-`;h<77uLs> ztiHLCfun+vt)-rU(JvVXx_{ilXNGdPyM(bbFr+v11rPx14`^;=Fj>DHE0i1qlRJWON>7dQ6K60kLw zH^vm&|I`RmrW+T!`4N$ywxr;WeA32-rl0gxs;J)I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cgo?DNlmgMCGZL_-2w*(aK%GfSR{8Vl|6lw$oZ$T_rQ1k0hJ_8 zjL{(N+X;v1OM}4ECZZ;#B}^_Bb7E%2_xC6K)6E9-7G!ldwG3EwR|ny&D8&mpALHa0 zjNRPc+I@ur1@_%IfO}gywJc45(J@-$sZkwqO2r(bWFc8s&C9^N6tTpFnAn%tJHybf zx!z5I&sSmZ=~h`+70~Ns1MgBI22w76CjHR*i}a6y_d;DEPehQH;$naAk1#Eu20LY`_S^g z9#%LRf&=wDYBDuIe}7m32!sIe>s;vHt>$O>ks1BRQ9q=xp61{Fp7i`@5q;eJcbbNO zOo9Ga(9^uq&p`{175+7d_OGC)Igg)%L?0ih{2D~_SJ2aBzt2I}kHI6q22uYN^fWW> z_k;sKix9{U(DO{eeFs4PdOF;z{-OUpZ^QlHA^)UzGDUC{e~e>OLNhx;>Y zdv3mjq`#@(|K);X@LS;j>4H=6JLLbq1K9Z;?oT>^=l(!U_L~;`Q-64VQjC9x{4<|@ z?qEf~1O5*V_Ea(bxr3cNrT)gjo(e8McQ87NCvEpn4))_B_*8Tl>gSdDaf^}WxlZ$6 zFP~4BmOwr`(w6p_MDbq_e7d6GF%Ixa=~w)@4&|>$Jq;UtUQsBO=W7ps9Qot^gi0t^R@ + + + + + diff --git a/src/geometry.h b/src/geometry.h index 1cbdaee..ecb9e4b 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -1,19 +1,21 @@ -#ifndef __GEOMETRY_H__ -#define __GEOMETRY_H__ - -#include "basis.h" - -#include "angle.h" - -#include "vector2.h" -#include "vector3.h" - +#ifndef __GEOMETRY_H__ +#define __GEOMETRY_H__ + +#include "basis.h" + +#include "angle.h" + +#include "vector2.h" +#include "vector3.h" + +#include "matrixes.h" #include "matrix2x2.h" -#include "matrix3x3.h" - -#include "rotation3.h" - -#include "quaternion.h" -#include "versor.h" - -#endif +#include "matrix2x3.h" +#include "matrix3x3.h" + +#include "rotation3.h" + +#include "quaternion.h" +#include "versor.h" + +#endif diff --git a/src/geometry.layout b/src/geometry.layout index 173e12c..8f5c836 100644 --- a/src/geometry.layout +++ b/src/geometry.layout @@ -2,59 +2,19 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -62,34 +22,34 @@ - + - + - + - + + + + + + - + - + - + - + - - - - - - + @@ -97,4 +57,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/geometry.vcxproj b/src/geometry.vcxproj index 7e406c9..7fed42e 100644 --- a/src/geometry.vcxproj +++ b/src/geometry.vcxproj @@ -1,175 +1,175 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - 16.0 - Win32Proj - {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} - geometry - 10.0 - - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - v143 - true - Unicode - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - - - - - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - - - - - true - true - true - - - - - Level3 - true - _DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - - - - - true - - - - - Level3 - true - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - - - - - true - true - true - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + 16.0 + Win32Proj + {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} + geometry + 10.0 + + + + StaticLibrary + true + v143 + Unicode + + + StaticLibrary + false + v143 + true + Unicode + + + StaticLibrary + true + v143 + Unicode + + + StaticLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + + + + + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + + + + + true + true + true + + + + + Level3 + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + + + + + true + + + + + Level3 + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + + + + + true + true + true + + + + + \ No newline at end of file diff --git a/src/geometry.vcxproj.filters b/src/geometry.vcxproj.filters index 8262b96..b851ec4 100644 --- a/src/geometry.vcxproj.filters +++ b/src/geometry.vcxproj.filters @@ -1,78 +1,78 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - Файлы заголовков - - - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + \ No newline at end of file diff --git a/src/geometry.vcxproj.user b/src/geometry.vcxproj.user index 88a5509..0f14913 100644 --- a/src/geometry.vcxproj.user +++ b/src/geometry.vcxproj.user @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/matrix2x2.c b/src/matrix2x2.c index 6ba579f..4bf7977 100644 --- a/src/matrix2x2.c +++ b/src/matrix2x2.c @@ -1,24 +1 @@ -#include "matrix2x2.h" - -#include -#include "angle.h" - -const SPMatrix2x2 SP_ZERO_MATRIX2X2 = { - 0.0f, 0.0f, - 0.0f, 0.0f -}; - -const DPMatrix2x2 DP_ZERO_MATRIX2X2 = { - 0.0, 0.0, - 0.0, 0.0 -}; - -const SPMatrix2x2 SP_IDENTITY_MATRIX2X2 = { - 1.0f, 0.0f, - 0.0f, 1.0f -}; - -const DPMatrix2x2 DP_IDENTITY_MATRIX2X2 = { - 1.0, 0.0, - 0.0, 1.0 -}; +#include "matrix2x2.h" diff --git a/src/matrix2x2.h b/src/matrix2x2.h index 5153223..eafea4e 100644 --- a/src/matrix2x2.h +++ b/src/matrix2x2.h @@ -3,24 +3,7 @@ #include "angle.h" #include "vector2.h" - -typedef struct { - float r1c1, r1c2; - float r2c1, r2c2; -} SPMatrix2x2; - -typedef struct { - double r1c1, r1c2; - double r2c1, r2c2; -} DPMatrix2x2; - -extern const SPMatrix2x2 SP_ZERO_MATRIX2X2; - -extern const DPMatrix2x2 DP_ZERO_MATRIX2X2; - -extern const SPMatrix2x2 SP_IDENTITY_MATRIX2X2; - -extern const DPMatrix2x2 DP_IDENTITY_MATRIX2X2; +#include "matrixes.h" // =================== Reset ==================== // @@ -124,22 +107,24 @@ static inline void dp_matrix2x2_copy(const DPMatrix2x2* from, DPMatrix2x2* to) // ============= Copy to twin type ============== // -static inline void sp_matrix2x2_copy_to_double(const SPMatrix2x2* from, DPMatrix2x2* to) -{ - to->r1c1 = (double)from->r1c1; - to->r1c2 = (double)from->r1c2; - to->r2c1 = (double)from->r2c1; - to->r2c2 = (double)from->r2c2; -} - -static inline void dp_matrix2x2_copy_to_single(const DPMatrix2x2* from, SPMatrix2x2* to) +static inline void sp_matrix2x2_set_from_double(const DPMatrix2x2* from, SPMatrix2x2* to) { to->r1c1 = (float)from->r1c1; to->r1c2 = (float)from->r1c2; + to->r2c1 = (float)from->r2c1; to->r2c2 = (float)from->r2c2; } +static inline void dp_matrix2x2_set_from_single(const SPMatrix2x2* from, DPMatrix2x2* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; +} + // ================ Determinant ================= // static inline float sp_matrix2x2_get_determinant(const SPMatrix2x2* matrix) @@ -232,98 +217,78 @@ static inline int dp_matrix2x2_invert(DPMatrix2x2* matrix) return 1; } -// =============== Make Transposed ============== // +// =============== Set Transposed =============== // -static inline void sp_matrix2x2_make_transposed(const SPMatrix2x2* matrix, SPMatrix2x2* result) +static inline void sp_matrix2x2_set_transposed(const SPMatrix2x2* from, SPMatrix2x2* to) { - if (matrix == result) { - sp_matrix2x2_transpose(result); - return; - } + float tmp = from->r1c2; - result->r1c1 = matrix->r1c1; - result->r1c2 = matrix->r2c1; + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; - result->r2c1 = matrix->r1c2; - result->r2c2 = matrix->r2c2; + to->r2c1 = tmp; + to->r2c2 = from->r2c2; } -static inline void dp_matrix2x2_make_transposed(const DPMatrix2x2* matrix, DPMatrix2x2* result) +static inline void dp_matrix2x2_set_transposed(const DPMatrix2x2* from, DPMatrix2x2* to) { - if (matrix == result) { - dp_matrix2x2_transpose(result); - return; - } + double tmp = from->r1c2; - result->r1c1 = matrix->r1c1; - result->r1c2 = matrix->r1c2; + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; - result->r2c1 = matrix->r2c1; - result->r2c2 = matrix->r2c2; + to->r2c1 = tmp; + to->r2c2 = from->r2c2; } -// ================ Make Inverted =============== // +// ================ Set Inverted ================ // -static inline int sp_matrix2x2_make_inverted(const SPMatrix2x2* matrix, SPMatrix2x2* result) +static inline int sp_matrix2x2_set_inverted(const SPMatrix2x2* from, SPMatrix2x2* to) { - const float determinant = sp_matrix2x2_get_determinant(matrix); + const float determinant = sp_matrix2x2_get_determinant(from); if (-SP_EPSYLON <= determinant && determinant <= SP_EPSYLON) { return 0; } - const float r1c1 = matrix->r2c2; - const float r1c2 = -matrix->r1c2; + const float r1c1 = from->r2c2; + const float r1c2 = -from->r1c2; - const float r2c1 = -matrix->r2c1; - const float r2c2 = matrix->r1c1; + const float r2c1 = -from->r2c1; + const float r2c2 = from->r1c1; - result->r1c1 = r1c1 / determinant; - result->r1c2 = r1c2 / determinant; + to->r1c1 = r1c1 / determinant; + to->r1c2 = r1c2 / determinant; - result->r2c1 = r2c1 / determinant; - result->r2c2 = r2c2 / determinant; + to->r2c1 = r2c1 / determinant; + to->r2c2 = r2c2 / determinant; return 1; } -static inline int dp_matrix2x2_make_inverted(const DPMatrix2x2* matrix, DPMatrix2x2* result) +static inline int dp_matrix2x2_set_inverted(const DPMatrix2x2* from, DPMatrix2x2* to) { - const double determinant = dp_matrix2x2_get_determinant(matrix); + const double determinant = dp_matrix2x2_get_determinant(from); if (-DP_EPSYLON <= determinant && determinant <= DP_EPSYLON) { return 0; } - const double r1c1 = matrix->r2c2; - const double r1c2 = -matrix->r1c2; + const double r1c1 = from->r2c2; + const double r1c2 = -from->r1c2; - const double r2c1 = -matrix->r2c1; - const double r2c2 = matrix->r1c1; + const double r2c1 = -from->r2c1; + const double r2c2 = from->r1c1; - result->r1c1 = r1c1 / determinant; - result->r1c2 = r1c2 / determinant; + to->r1c1 = r1c1 / determinant; + to->r1c2 = r1c2 / determinant; - result->r2c1 = r2c1 / determinant; - result->r2c2 = r2c2 / determinant; + to->r2c1 = r2c1 / determinant; + to->r2c2 = r2c2 / determinant; return 1; } -// ================ Set Diagonal ================ // - -static inline void sp_matrix2x2_set_main_diagonal(const float d1, const float d2, SPMatrix2x2* matrix) -{ - matrix->r1c1 = d1; - matrix->r2c2 = d2; -} - -static inline void dp_matrix2x2_set_main_diagonal(const double d1, const double d2, DPMatrix2x2* matrix) -{ - matrix->r1c1 = d1; - matrix->r2c2 = d2; -} - // ================= Set Row 1 ================== // static inline void sp_matrix2x2_set_row1(const float c1, const float c2, SPMatrix2x2* matrix) @@ -720,36 +685,4 @@ static inline void dp_matrix2x2_right_product(const DPMatrix2x2* matrix, const D ); } -// =============== Matrix Product =============== // - -static inline void sp_matrix2x2_matrix_product(const SPMatrix2x2* matrix1, const SPMatrix2x2* matrix2, SPMatrix2x2* result) -{ - const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; - const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; - - const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; - const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; - - result->r1c1 = r1c1; - result->r1c2 = r1c2; - - result->r2c1 = r2c1; - result->r2c2 = r2c2; -} - -static inline void dp_matrix2x2_matrix_product(const DPMatrix2x2* matrix1, const DPMatrix2x2* matrix2, DPMatrix2x2* result) -{ - const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; - const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; - - const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; - const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; - - result->r1c1 = r1c1; - result->r1c2 = r1c2; - - result->r2c1 = r2c1; - result->r2c2 = r2c2; -} - #endif diff --git a/src/matrix2x3.h b/src/matrix2x3.h new file mode 100644 index 0000000..ef7eead --- /dev/null +++ b/src/matrix2x3.h @@ -0,0 +1,141 @@ +#ifndef _GEOMETRY_MATRIX2X3_H_ +#define _GEOMETRY_MATRIX2X3_H_ + +#include "vector2.h" +#include "vector3.h" +#include "matrixes.h" + +// =================== Reset ==================== // + +static inline void sp_matrix2x3_reset(SPMatrix2x3* matrix) +{ + matrix->r1c1 = 0.0f; + matrix->r1c2 = 0.0f; + + matrix->r2c1 = 0.0f; + matrix->r2c2 = 0.0f; + + matrix->r3c1 = 0.0f; + matrix->r3c2 = 0.0f; +} + +static inline void dp_matrix2x3_reset(DPMatrix2x3* matrix) +{ + matrix->r1c1 = 0.0; + matrix->r1c2 = 0.0; + + matrix->r2c1 = 0.0; + matrix->r2c2 = 0.0; + + matrix->r3c1 = 0.0; + matrix->r3c2 = 0.0; +} + +// ==================== Copy ==================== // + +static inline void sp_matrix2x3_copy(const SPMatrix2x3* from, SPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + to->r1c3 = from->r1c3; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; + to->r2c3 = from->r2c3; + + to->r3c1 = from->r3c1; + to->r3c2 = from->r3c2; + to->r3c3 = from->r3c3; +} + +static inline void dp_matrix2x3_copy(const DPMatrix2x3* from, DPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; + + to->r3c1 = from->r3c1; + to->r3c2 = from->r3c2; +} + +// ============= Copy to twin type ============== // + +static inline void sp_matrix2x3_set_from_double(const DPMatrix2x3* from, SPMatrix2x3* to) +{ + to->r1c1 = (float) from->r1c1; + to->r1c2 = (float) from->r1c2; + + to->r2c1 = (float) from->r2c1; + to->r2c2 = (float) from->r2c2; + + to->r3c1 = (float) from->r3c1; + to->r3c2 = (float) from->r3c2; +} + +static inline void dp_matrix2x3_set_from_single(const SPMatrix2x3* from, DPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; + + to->r3c1 = from->r3c1; + to->r3c2 = from->r3c2; +} + +// =============== Set transposed =============== // + +static inline void sp_matrix2x3_set_transposed(const SPMatrix3x2* from, SPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + + to->r3c1 = from->r1c3; + to->r3c2 = from->r2c3; +} + +static inline void dp_matrix2x3_set_transposed(const DPMatrix3x2* from, DPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + + to->r3c1 = from->r1c3; + to->r3c2 = from->r2c3; +} + +// =============== Set transposed =============== // + +static inline void sp_matrix2x3_transpose_double(const DPMatrix3x2* from, SPMatrix2x3* to) +{ + to->r1c1 = (float) from->r1c1; + to->r1c2 = (float) from->r2c1; + + to->r2c1 = (float) from->r1c2; + to->r2c2 = (float) from->r2c2; + + to->r3c1 = (float) from->r1c3; + to->r3c2 = (float) from->r2c3; +} + +static inline void dp_matrix2x3_transpose_single(const SPMatrix3x2* from, DPMatrix2x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + + to->r3c1 = from->r1c3; + to->r3c2 = from->r2c3; +} + +#endif diff --git a/src/matrix3x2.h b/src/matrix3x2.h new file mode 100644 index 0000000..9cbd73e --- /dev/null +++ b/src/matrix3x2.h @@ -0,0 +1,100 @@ +#ifndef _GEOMETRY_MATRIX3X2_H_ +#define _GEOMETRY_MATRIX3X2_H_ + +// =================== Reset ==================== // + +static inline void sp_matrix3x2_reset(SPMatrix3x2* matrix) +{ + matrix->r1c1 = 0.0f; + matrix->r1c2 = 0.0f; + matrix->r1c3 = 0.0f; + + matrix->r2c1 = 0.0f; + matrix->r2c2 = 0.0f; + matrix->r2c3 = 0.0f; +} + +static inline void dp_matrix3x2_reset(DPMatrix3x2* matrix) +{ + matrix->r1c1 = 0.0; + matrix->r1c2 = 0.0; + matrix->r1c3 = 0.0; + + matrix->r2c1 = 0.0; + matrix->r2c2 = 0.0; + matrix->r2c3 = 0.0; +} + +// ============= Set from twin type ============= // + +static inline void sp_matrix3x2_set_from_double(const DPMatrix3x2* from, SPMatrix3x2* to) +{ + to->r1c1 = (float) from->r1c1; + to->r1c2 = (float) from->r1c2; + to->r1c3 = (float) from->r1c3; + + to->r2c1 = (float) from->r2c1; + to->r2c2 = (float) from->r2c2; + to->r2c3 = (float) from->r2c3; +} + +static inline void dp_matrix3x2_set_from_single(const SPMatrix3x2* from, DPMatrix3x2* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + to->r1c3 = from->r1c3; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; + to->r2c3 = from->r2c3; +} + +// =============== Set transposed =============== // + +static inline void sp_matrix3x2_set_transposed(const SPMatrix2x3* from, SPMatrix3x2* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + to->r1c3 = from->r3c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + to->r2c3 = from->r3c2; +} + +static inline void dp_matrix3x2_set_transposed(const DPMatrix2x3* from, DPMatrix3x2* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + to->r1c3 = from->r3c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + to->r2c3 = from->r3c2; +} + +// =============== Set transposed =============== // + +static inline void sp_matrix3x2_transpose_double(const DPMatrix2x3* from, SPMatrix3x2* to) +{ + to->r1c1 = (float) from->r1c1; + to->r1c2 = (float) from->r2c1; + to->r1c3 = (float) from->r3c1; + + to->r2c1 = (float) from->r1c2; + to->r2c2 = (float) from->r2c2; + to->r2c3 = (float) from->r3c2; +} + +static inline void dp_matrix3x2_transpose_single(const SPMatrix2x3* from, DPMatrix3x2* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r2c1; + to->r1c3 = from->r3c1; + + to->r2c1 = from->r1c2; + to->r2c2 = from->r2c2; + to->r2c3 = from->r3c2; +} + +#endif diff --git a/src/matrix3x3.c b/src/matrix3x3.c index 224a5e6..8111347 100644 --- a/src/matrix3x3.c +++ b/src/matrix3x3.c @@ -1,29 +1,5 @@ #include "matrix3x3.h" -const SPMatrix3x3 SP_ZERO_MATRIX3X3 = { - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f -}; - -const DPMatrix3x3 DP_ZERO_MATRIX3X3 = { - 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0 -}; - -const SPMatrix3x3 SP_IDENTITY_MATRIX3X3 = { - 1.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 1.0f -}; - -const DPMatrix3x3 DP_IDENTITY_MATRIX3X3 = { - 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0 -}; - // ================= Inversion ================== // int sp_matrix3x3_invert(SPMatrix3x3* matrix) @@ -339,59 +315,3 @@ void dp_matrix3x3_get_weighted_sum5( sum->r3c2 = (matrix1->r3c2 * weight1 + matrix2->r3c2 * weight2) + (matrix3->r3c2 * weight3 + matrix4->r3c2 * weight4) + matrix5->r3c2 * weight5; sum->r3c3 = (matrix1->r3c3 * weight1 + matrix2->r3c3 * weight2) + (matrix3->r3c3 * weight3 + matrix4->r3c3 * weight4) + matrix5->r3c3 * weight5; } - -// =============== Matrix Product =============== // - -void sp_matrix3x3_matrix_product(const SPMatrix3x3* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x3* result) -{ - const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; - const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; - const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; - - const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; - const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; - const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; - - const float r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; - const float r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; - const float r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3 + matrix1->r3c3 * matrix2->r3c3; - - result->r1c1 = r1c1; - result->r1c2 = r1c2; - result->r1c3 = r1c3; - - result->r2c1 = r2c1; - result->r2c2 = r2c2; - result->r2c3 = r2c3; - - result->r3c1 = r3c1; - result->r3c2 = r3c2; - result->r3c3 = r3c3; -} - -void dp_matrix3x3_matrix_product(const DPMatrix3x3* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x3* result) -{ - const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; - const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; - const double r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; - - const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; - const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; - const double r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; - - const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; - const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; - const double r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3 + matrix1->r3c3 * matrix2->r3c3; - - result->r1c1 = r1c1; - result->r1c2 = r1c2; - result->r1c3 = r1c3; - - result->r2c1 = r2c1; - result->r2c2 = r2c2; - result->r2c3 = r2c3; - - result->r3c1 = r3c1; - result->r3c2 = r3c2; - result->r3c3 = r3c3; -} diff --git a/src/matrix3x3.h b/src/matrix3x3.h index 25d5595..2e1ea9d 100644 --- a/src/matrix3x3.h +++ b/src/matrix3x3.h @@ -2,26 +2,7 @@ #define _GEOMETRY_MATRIX3X3_H_ #include "vector3.h" - -typedef struct { - float r1c1, r1c2, r1c3; - float r2c1, r2c2, r2c3; - float r3c1, r3c2, r3c3; -} SPMatrix3x3; - -typedef struct { - double r1c1, r1c2, r1c3; - double r2c1, r2c2, r2c3; - double r3c1, r3c2, r3c3; -} DPMatrix3x3; - -extern const SPMatrix3x3 SP_ZERO_MATRIX3X3; - -extern const DPMatrix3x3 DP_ZERO_MATRIX3X3; - -extern const SPMatrix3x3 SP_IDENTITY_MATRIX3X3; - -extern const DPMatrix3x3 DP_IDENTITY_MATRIX3X3; +#include "matrixes.h" // =================== Reset ==================== // @@ -151,24 +132,9 @@ static inline void dp_matrix3x3_copy(const DPMatrix3x3* from, DPMatrix3x3* to) to->r3c3 = from->r3c3; } -// ============= Copy to twin type ============== // +// ============= Set from twin type ============= // -static inline void sp_matrix3x3_copy_to_double(const SPMatrix3x3* from, DPMatrix3x3* to) -{ - to->r1c1 = (double)from->r1c1; - to->r1c2 = (double)from->r1c2; - to->r1c3 = (double)from->r1c3; - - to->r2c1 = (double)from->r2c1; - to->r2c2 = (double)from->r2c2; - to->r2c3 = (double)from->r2c3; - - to->r3c1 = (double)from->r3c1; - to->r3c2 = (double)from->r3c2; - to->r3c3 = (double)from->r3c3; -} - -static inline void dp_matrix3x3_copy_to_single(const DPMatrix3x3* from, SPMatrix3x3* to) +static inline void sp_matrix3x3_set_from_double(const DPMatrix3x3* from, SPMatrix3x3* to) { to->r1c1 = (float)from->r1c1; to->r1c2 = (float)from->r1c2; @@ -183,6 +149,21 @@ static inline void dp_matrix3x3_copy_to_single(const DPMatrix3x3* from, SPMatrix to->r3c3 = (float)from->r3c3; } +static inline void dp_matrix3x3_set_from_single(const SPMatrix3x3* from, DPMatrix3x3* to) +{ + to->r1c1 = from->r1c1; + to->r1c2 = from->r1c2; + to->r1c3 = from->r1c3; + + to->r2c1 = from->r2c1; + to->r2c2 = from->r2c2; + to->r2c3 = from->r2c3; + + to->r3c1 = from->r3c1; + to->r3c2 = from->r3c2; + to->r3c3 = from->r3c3; +} + // ================ Determinant ================= // static inline float sp_matrix3x3_get_determinant(const SPMatrix3x3* matrix) @@ -785,10 +766,4 @@ static inline void dp_matrix3x3_right_product(const DPMatrix3x3* matrix, const D ); } -// =============== Matrix Product =============== // - -void sp_matrix3x3_matrix_product(const SPMatrix3x3* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x3* result); - -void dp_matrix3x3_matrix_product(const DPMatrix3x3* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x3* result); - #endif diff --git a/src/matrixes.c b/src/matrixes.c new file mode 100644 index 0000000..8be7c36 --- /dev/null +++ b/src/matrixes.c @@ -0,0 +1,257 @@ +#include "matrixes.h" + +// ========== Matrix Product 2x2 at 3x2 ========= // + +void sp_matrix_product_2x2_at_3x2(const SPMatrix2x2* matrix1, const SPMatrix3x2* matrix2, SPMatrix3x2* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; +} + +void dp_matrix_product_2x2_at_3x2(const DPMatrix2x2* matrix1, const DPMatrix3x2* matrix2, DPMatrix3x2* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + const double r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + const double r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; +} + +// ========== Matrix Product 2x3 at 2x2 ========= // + +void sp_matrix_product_2x3_at_2x2(const SPMatrix2x3* matrix1, const SPMatrix2x2* matrix2, SPMatrix2x3* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + + const float r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1; + const float r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; +} + +void dp_matrix_product_2x3_at_2x2(const DPMatrix2x3* matrix1, const DPMatrix2x2* matrix2, DPMatrix2x3* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + + const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1; + const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; +} + +// ========== Matrix Product 2x3 at 3x2 ========= // + +void sp_matrix_product_2x3_at_3x2(const SPMatrix2x3* matrix1, const SPMatrix3x2* matrix2, SPMatrix3x3* result) +{ + result->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + result->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + result->r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3; + + result->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + result->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + result->r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3; + + result->r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1; + result->r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2; + result->r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3; +} + +void dp_matrix_product_2x3_at_3x2(const DPMatrix2x3* matrix1, const DPMatrix3x2* matrix2, DPMatrix3x3* result) +{ + result->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + result->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + result->r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3; + + result->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + result->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + result->r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3; + + result->r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1; + result->r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2; + result->r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3; +} + +// ========== Matrix Product 3x2 at 3x3 ========= // + +void sp_matrix_product_3x2_at_3x3(const SPMatrix3x2* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x2* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; +} + +void dp_matrix_product_3x2_at_3x3(const DPMatrix3x2* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x2* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; +} + +// ========== Matrix Product 3x3 at 2x3 ========= // + +void sp_matrix_product_3x3_at_2x3(const SPMatrix3x3* matrix1, const SPMatrix2x3* matrix2, SPMatrix2x3* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + + const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; + const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; +} + +void dp_matrix_product_3x3_at_2x3(const DPMatrix3x3* matrix1, const DPMatrix2x3* matrix2, DPMatrix2x3* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + + const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; + const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; +} + +// ========== Matrix Product 3x3 at 3x3 ========= // + +void sp_matrix_product_3x3_at_3x3(const SPMatrix3x3* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x3* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + const float r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + const float r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; + + const float r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; + const float r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; + const float r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3 + matrix1->r3c3 * matrix2->r3c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; + result->r3c3 = r3c3; +} + +void dp_matrix_product_3x3_at_3x3(const DPMatrix3x3* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x3* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + const double r1c3 = matrix1->r1c1 * matrix2->r1c3 + matrix1->r1c2 * matrix2->r2c3 + matrix1->r1c3 * matrix2->r3c3; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; + const double r2c3 = matrix1->r2c1 * matrix2->r1c3 + matrix1->r2c2 * matrix2->r2c3 + matrix1->r2c3 * matrix2->r3c3; + + const double r3c1 = matrix1->r3c1 * matrix2->r1c1 + matrix1->r3c2 * matrix2->r2c1 + matrix1->r3c3 * matrix2->r3c1; + const double r3c2 = matrix1->r3c1 * matrix2->r1c2 + matrix1->r3c2 * matrix2->r2c2 + matrix1->r3c3 * matrix2->r3c2; + const double r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3 + matrix1->r3c3 * matrix2->r3c3; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + result->r1c3 = r1c3; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; + result->r2c3 = r2c3; + + result->r3c1 = r3c1; + result->r3c2 = r3c2; + result->r3c3 = r3c3; +} diff --git a/src/matrixes.h b/src/matrixes.h new file mode 100644 index 0000000..dd63a11 --- /dev/null +++ b/src/matrixes.h @@ -0,0 +1,144 @@ +#ifndef _GEOMETRY_MATRIX_TYPES_H_ +#define _GEOMETRY_MATRIX_TYPES_H_ + +// ================== Matrix2x2 ================= // + +typedef struct { + float r1c1, r1c2; + float r2c1, r2c2; +} SPMatrix2x2; + +typedef struct { + double r1c1, r1c2; + double r2c1, r2c2; +} DPMatrix2x2; + +// ================== Matrix2x3 ================= // + +typedef struct { + float r1c1, r1c2; + float r2c1, r2c2; + float r3c1, r3c2; +} SPMatrix2x3; + +typedef struct { + double r1c1, r1c2; + double r2c1, r2c2; + double r3c1, r3c2; +} DPMatrix2x3; + +// ================== Matrix3x2 ================= // + +typedef struct { + float r1c1, r1c2, r1c3; + float r2c1, r2c2, r2c3; +} SPMatrix3x2; + +typedef struct { + double r1c1, r1c2, r1c3; + double r2c1, r2c2, r2c3; +} DPMatrix3x2; + +// ================== Matrix3x3 ================= // + +typedef struct { + float r1c1, r1c2, r1c3; + float r2c1, r2c2, r2c3; + float r3c1, r3c2, r3c3; +} SPMatrix3x3; + +typedef struct { + double r1c1, r1c2, r1c3; + double r2c1, r2c2, r2c3; + double r3c1, r3c2, r3c3; +} DPMatrix3x3; + +// ========== Matrix Product 2x2 at 2x2 ========= // + +static inline void sp_matrix_product_2x2_at_2x2(const SPMatrix2x2* matrix1, const SPMatrix2x2* matrix2, SPMatrix2x2* result) +{ + const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + + const float r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const float r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; +} + +static inline void dp_matrix_product_2x2_at_2x2(const DPMatrix2x2* matrix1, const DPMatrix2x2* matrix2, DPMatrix2x2* result) +{ + const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1; + const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2; + + const double r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1; + const double r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2; + + result->r1c1 = r1c1; + result->r1c2 = r1c2; + + result->r2c1 = r2c1; + result->r2c2 = r2c2; +} + +// ========== Matrix Product 2x2 at 3x2 ========= // + +void sp_matrix_product_2x2_at_3x2(const SPMatrix2x2* matrix1, const SPMatrix3x2* matrix2, SPMatrix3x2* result); + +void dp_matrix_product_2x2_at_3x2(const DPMatrix2x2* matrix1, const DPMatrix3x2* matrix2, DPMatrix3x2* result); + +// ========== Matrix Product 2x3 at 2x2 ========= // + +void sp_matrix_product_2x3_at_2x2(const SPMatrix2x3* matrix1, const SPMatrix2x2* matrix2, SPMatrix2x3* result); + +void dp_matrix_product_2x3_at_2x2(const DPMatrix2x3* matrix1, const DPMatrix2x2* matrix2, DPMatrix2x3* result); + +// ========== Matrix Product 2x3 at 3x2 ========= // + +void sp_matrix_product_2x3_at_3x2(const SPMatrix2x3* matrix1, const SPMatrix3x2* matrix2, SPMatrix3x3* result); + +void dp_matrix_product_2x3_at_3x2(const DPMatrix2x3* matrix1, const DPMatrix3x2* matrix2, DPMatrix3x3* result); + +// ========== Matrix Product 3x2 at 2x3 ========= // + +void sp_matrix_product_3x2_at_2x3(const SPMatrix3x2* matrix1, const SPMatrix2x3* matrix2, SPMatrix2x2* result) +{ + result->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + result->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + + result->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + result->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; +} + +void dp_matrix_product_3x2_at_2x3(const DPMatrix3x2* matrix1, const DPMatrix2x3* matrix2, DPMatrix2x2* result) +{ + result->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1; + result->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2; + + result->r2c1 = matrix1->r2c1 * matrix2->r1c1 + matrix1->r2c2 * matrix2->r2c1 + matrix1->r2c3 * matrix2->r3c1; + result->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2; +} + +// ========== Matrix Product 3x2 at 3x3 ========= // + +void sp_matrix_product_3x2_at_3x3(const SPMatrix3x2* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x2* result); + +void dp_matrix_product_3x2_at_3x3(const DPMatrix3x2* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x2* result); + +// ========== Matrix Product 3x3 at 2x3 ========= // + +void sp_matrix_product_3x3_at_2x3(const SPMatrix3x3* matrix1, const SPMatrix2x3* matrix2, SPMatrix2x3* result); + +void dp_matrix_product_3x3_at_2x3(const DPMatrix3x3* matrix1, const DPMatrix2x3* matrix2, DPMatrix2x3* result); + +// ========== Matrix Product 3x3 at 3x3 ========= // + +void sp_matrix_product_3x3_at_3x3(const SPMatrix3x3* matrix1, const SPMatrix3x3* matrix2, SPMatrix3x3* result); + +void dp_matrix_product_3x3_at_3x3(const DPMatrix3x3* matrix1, const DPMatrix3x3* matrix2, DPMatrix3x3* result); + +#endif // _GEOMETRY_MATRIX_TYPES_H_ diff --git a/src/quaternion.h b/src/quaternion.h index 37b590f..b818083 100644 --- a/src/quaternion.h +++ b/src/quaternion.h @@ -32,9 +32,27 @@ static inline void dp_quaternion_reset(DPQuaternion * quaternion) quaternion->x3 = 0.0; } +// ================== Set Unit ================== // + +static inline void sp_quaternion_set_identity(SPQuaternion * quaternion) +{ + quaternion->s0 = 1.0f; + quaternion->x1 = 0.0f; + quaternion->x2 = 0.0f; + quaternion->x3 = 0.0f; +} + +static inline void dp_quaternion_set_identity(DPQuaternion * quaternion) +{ + quaternion->s0 = 1.0; + quaternion->x1 = 0.0; + quaternion->x2 = 0.0; + quaternion->x3 = 0.0; +} + // ==================== Set ===================== // -static inline void sp_quaternion_set(const float s0, const float x1, const float x2, const float x3, SPQuaternion * quaternion) +static inline void sp_quaternion_set_values(const float s0, const float x1, const float x2, const float x3, SPQuaternion * quaternion) { quaternion->s0 = s0; quaternion->x1 = x1; @@ -42,7 +60,7 @@ static inline void sp_quaternion_set(const float s0, const float x1, const float quaternion->x3 = x3; } -static inline void dp_quaternion_set(const double s0, const double x1, const double x2, const double x3, DPQuaternion * quaternion) +static inline void dp_quaternion_set_values(const double s0, const double x1, const double x2, const double x3, DPQuaternion * quaternion) { quaternion->s0 = s0; quaternion->x1 = x1; @@ -70,15 +88,7 @@ static inline void dp_quaternion_copy(const DPQuaternion* from, DPQuaternion* to // ============= Copy to twin type ============== // -static inline void sp_quaternion_copy_to_double(const SPQuaternion* versor, DPQuaternion* result) -{ - result->s0 = (double)versor->s0; - result->x1 = (double)versor->x1; - result->x2 = (double)versor->x2; - result->x3 = (double)versor->x3; -} - -static inline void dp_quaternion_copy_to_single(const DPQuaternion* versor, SPQuaternion* result) +static inline void sp_quaternion_copy_from_double(const DPQuaternion* versor, SPQuaternion* result) { result->s0 = (float)versor->s0; result->x1 = (float)versor->x1; @@ -86,6 +96,14 @@ static inline void dp_quaternion_copy_to_single(const DPQuaternion* versor, SPQu result->x3 = (float)versor->x3; } +static inline void dp_quaternion_copy_from_single(const SPQuaternion* versor, DPQuaternion* result) +{ + result->s0 = versor->s0; + result->x1 = versor->x1; + result->x2 = versor->x2; + result->x3 = versor->x3; +} + // ================= Inversion ================== // static inline void sp_quaternion_conjugate(SPQuaternion* versor) @@ -102,9 +120,9 @@ static inline void dp_quaternion_conjugate(DPQuaternion* versor) versor->x3 = -versor->x3; } -// ================ Get Inverted ================ // +// ================ Set Conjugate =============== // -static inline void sp_quaternion_get_conjugate(const SPQuaternion* versor, SPQuaternion* result) +static inline void sp_quaternion_set_conjugate(const SPQuaternion* versor, SPQuaternion* result) { result->s0 = versor->s0; result->x1 = -versor->x1; @@ -112,7 +130,25 @@ static inline void sp_quaternion_get_conjugate(const SPQuaternion* versor, SPQua result->x3 = -versor->x3; } -static inline void dp_quaternion_get_conjugate(const DPQuaternion* versor, DPQuaternion* result) +static inline void dp_quaternion_set_conjugate(const DPQuaternion* versor, DPQuaternion* result) +{ + result->s0 = versor->s0; + result->x1 = -versor->x1; + result->x2 = -versor->x2; + result->x3 = -versor->x3; +} + +// ================ Get Inverted ================ // + +static inline void sp_quaternion_conjugate_double(const DPQuaternion* versor, SPQuaternion* result) +{ + result->s0 = (float)versor->s0; + result->x1 = -(float)versor->x1; + result->x2 = -(float)versor->x2; + result->x3 = -(float)versor->x3; +} + +static inline void dp_quaternion_conjugate_single(const SPQuaternion* versor, DPQuaternion* result) { result->s0 = versor->s0; result->x1 = -versor->x1; diff --git a/src/vector2.c b/src/vector2.c index 3a53b70..85654d5 100644 --- a/src/vector2.c +++ b/src/vector2.c @@ -1,73 +1,73 @@ -#include "vector2.h" - -const SPVector2 SP_ZERO_VECTOR2 = { 0.0f, 0.0f }; -const SPVector2 SP_X1_UNIT_VECTOR2 = { 1.0f, 0.0f }; -const SPVector2 SP_X2_UNIT_VECTOR2 = { 0.0f, 1.0f }; - -const DPVector2 DP_ZERO_VECTOR2 = { 0.0, 0.0 }; -const DPVector2 DP_X1_UNIT_VECTOR2 = { 1.0, 0.0 }; -const DPVector2 DP_X2_UNIT_VECTOR2 = { 0.0, 1.0 }; - -// =================== Angle ==================== // - -float sp_vector2_angle(const SPVector2* vector1, const SPVector2* vector2, const angle_unit_t unit) -{ - if (vector1 == 0 || vector2 == 0) { - return 0.0f; - } - - const float square_module1 = sp_vector2_get_square_module(vector1); - - if (square_module1 <= SP_SQUARE_EPSYLON) { - return 0.0f; - } - - const float square_module2 = sp_vector2_get_square_module(vector2); - - if (square_module2 <= SP_SQUARE_EPSYLON) { - return 0.0f; - } - - const float cosine = sp_vector2_scalar(vector1, vector2) / sqrtf(square_module1 * square_module2); - - if (cosine >= 1.0f - SP_EPSYLON) { - return 0.0f; - } - - if (cosine <= -1.0f + SP_EPSYLON) { - return sp_get_half_circle(unit); - } - - return sp_convert_from_radians(acosf(cosine), unit); -} - -double dp_vector2_angle(const DPVector2* vector1, const DPVector2* vector2, const angle_unit_t unit) -{ - if (vector1 == 0 || vector2 == 0) { - return 0.0; - } - - const double square_module1 = dp_vector2_get_square_module(vector1); - - if (square_module1 <= DP_SQUARE_EPSYLON) { - return 0.0; - } - - const double square_module2 = dp_vector2_get_square_module(vector2); - - if (square_module2 <= DP_SQUARE_EPSYLON) { - return 0.0; - } - - const double cosine = dp_vector2_scalar(vector1, vector2) / sqrt(square_module1 * square_module2); - - if (cosine >= 1.0 - DP_EPSYLON) { - return 0.0; - } - - if (cosine <= -1.0 + DP_EPSYLON) { - return dp_get_half_circle(unit); - } - - return dp_convert_from_radians(acos(cosine), unit); -} +#include "vector2.h" + +const SPVector2 SP_ZERO_VECTOR2 = { 0.0f, 0.0f }; +const SPVector2 SP_X1_UNIT_VECTOR2 = { 1.0f, 0.0f }; +const SPVector2 SP_X2_UNIT_VECTOR2 = { 0.0f, 1.0f }; + +const DPVector2 DP_ZERO_VECTOR2 = { 0.0, 0.0 }; +const DPVector2 DP_X1_UNIT_VECTOR2 = { 1.0, 0.0 }; +const DPVector2 DP_X2_UNIT_VECTOR2 = { 0.0, 1.0 }; + +// =================== Angle ==================== // + +float sp_vector2_angle(const SPVector2* vector1, const SPVector2* vector2, const angle_unit_t unit) +{ + if (vector1 == 0 || vector2 == 0) { + return 0.0f; + } + + const float square_module1 = sp_vector2_get_square_module(vector1); + + if (square_module1 <= SP_SQUARE_EPSYLON) { + return 0.0f; + } + + const float square_module2 = sp_vector2_get_square_module(vector2); + + if (square_module2 <= SP_SQUARE_EPSYLON) { + return 0.0f; + } + + const float cosine = sp_vector2_scalar(vector1, vector2) / sqrtf(square_module1 * square_module2); + + if (cosine >= 1.0f - SP_EPSYLON) { + return 0.0f; + } + + if (cosine <= -1.0f + SP_EPSYLON) { + return sp_get_half_circle(unit); + } + + return sp_convert_from_radians(acosf(cosine), unit); +} + +double dp_vector2_angle(const DPVector2* vector1, const DPVector2* vector2, const angle_unit_t unit) +{ + if (vector1 == 0 || vector2 == 0) { + return 0.0; + } + + const double square_module1 = dp_vector2_get_square_module(vector1); + + if (square_module1 <= DP_SQUARE_EPSYLON) { + return 0.0; + } + + const double square_module2 = dp_vector2_get_square_module(vector2); + + if (square_module2 <= DP_SQUARE_EPSYLON) { + return 0.0; + } + + const double cosine = dp_vector2_scalar(vector1, vector2) / sqrt(square_module1 * square_module2); + + if (cosine >= 1.0 - DP_EPSYLON) { + return 0.0; + } + + if (cosine <= -1.0 + DP_EPSYLON) { + return dp_get_half_circle(unit); + } + + return dp_convert_from_radians(acos(cosine), unit); +} diff --git a/src/vector2.h b/src/vector2.h index e1c4a1c..c2a4aec 100644 --- a/src/vector2.h +++ b/src/vector2.h @@ -38,6 +38,20 @@ static inline void dp_vector2_reset(DPVector2* vector) vector->x2 = 0.0; } +// ==================== Set ===================== // + +static inline void sp_vector2_set_values(const float x1, const float x2, SPVector2* to) +{ + to->x1 = x1; + to->x2 = x2; +} + +static inline void dp_vector2_set_values(const double x1, const double x2, DPVector2* to) +{ + to->x1 = x1; + to->x2 = x2; +} + // ==================== Copy ==================== // static inline void sp_vector2_copy(const SPVector2* from, SPVector2* to) @@ -52,18 +66,46 @@ static inline void dp_vector2_copy(const DPVector2* from, DPVector2* to) to->x2 = from->x2; } -// ==================== Set ===================== // +// ============= Copy to twin type ============== // -static inline void sp_vector2_set(const float x1, const float x2, SPVector2* to) +static inline void sp_vector2_copy_from_double(const DPVector2* from, SPVector2* to) { - to->x1 = x1; - to->x2 = x2; + to->x1 = (float)from->x1; + to->x2 = (float)from->x2; } -static inline void dp_vector2_set(const double x1, const double x2, DPVector2* to) +static inline void dp_vector2_copy_from_single(const SPVector2* from, DPVector2* to) { - to->x1 = x1; - to->x2 = x2; + to->x1 = from->x1; + to->x2 = from->x2; +} + +// =================== Reverse ================== // + +static inline void sp_vector2_reverse(const SPVector2* from, SPVector2* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; +} + +static inline void dp_vector2_reverse(const DPVector2* from, DPVector2* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; +} + +// ============= Reverse twin type ============== // + +static inline void sp_vector2_reverse_double(const DPVector2* from, SPVector2* to) +{ + to->x1 = -(float)from->x1; + to->x2 = -(float)from->x2; +} + +static inline void dp_vector2_reverse_single(const SPVector2* from, DPVector2* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; } // =================== Module =================== // @@ -114,48 +156,6 @@ static inline int dp_vector2_is_unit(const DPVector2* vector) return 1.0f - DP_TWO_EPSYLON <= square_module && square_module <= 1.0f + DP_TWO_EPSYLON; } -// ============= Copy to twin type ============== // - -static inline void sp_vector2_copy_to_double(const SPVector2* from, DPVector2* to) -{ - to->x1 = (double)from->x1; - to->x2 = (double)from->x2; -} - -static inline void dp_vector2_copy_to_single(const DPVector2* from, SPVector2* to) -{ - to->x1 = (float)from->x1; - to->x2 = (float)from->x2; -} - -// ================= Inversion ================== // - -static inline void sp_vector2_invert(SPVector2* vector) -{ - vector->x1 = -vector->x1; - vector->x2 = -vector->x2; -} - -static inline void dp_vector2_invert(DPVector2* vector) -{ - vector->x1 = -vector->x1; - vector->x2 = -vector->x2; -} - -// ================ Get Inverted ================ // - -static inline void sp_vector2_get_inverted(const SPVector2* vector, SPVector2* result) -{ - result->x1 = -vector->x1; - result->x2 = -vector->x2; -} - -static inline void dp_vector2_get_inverted(const DPVector2* vector, DPVector2* result) -{ - result->x1 = -vector->x1; - result->x2 = -vector->x2; -} - // ==================== Add ===================== // static inline void sp_vector2_add(const SPVector2* vector1, const SPVector2* vector2, SPVector2* result) diff --git a/src/vector3.c b/src/vector3.c index ffd3c49..7ec09a7 100644 --- a/src/vector3.c +++ b/src/vector3.c @@ -1,75 +1,75 @@ -#include "vector3.h" - -const SPVector3 SP_ZERO_VECTOR3 = { 0.0f, 0.0f, 0.0f }; -const SPVector3 SP_X1_UNIT_VECTOR3 = { 1.0f, 0.0f, 0.0f }; -const SPVector3 SP_X2_UNIT_VECTOR3 = { 0.0f, 1.0f, 0.0f }; -const SPVector3 SP_X3_UNIT_VECTOR3 = { 0.0f, 0.0f, 1.0f }; - -const DPVector3 DP_ZERO_VECTOR3 = { 0.0, 0.0, 0.0 }; -const DPVector3 DP_X1_UNIT_VECTOR3 = { 1.0, 0.0, 0.0 }; -const DPVector3 DP_X2_UNIT_VECTOR3 = { 0.0, 1.0, 0.0 }; -const DPVector3 DP_X3_UNIT_VECTOR3 = { 0.0, 0.0, 1.0 }; - -// =================== Angle ==================== // - -float sp_vector3_angle(const SPVector3* vector1, const SPVector3* vector2, const angle_unit_t unit) -{ - if (vector1 == 0 || vector2 == 0) { - return 0.0f; - } - - const float square_module1 = sp_vector3_get_square_module(vector1); - - if (square_module1 <= SP_SQUARE_EPSYLON) { - return 0.0f; - } - - const float square_module2 = sp_vector3_get_square_module(vector2); - - if (square_module2 <= SP_SQUARE_EPSYLON) { - return 0.0f; - } - - const float cosine = sp_vector3_scalar(vector1, vector2) / sqrtf(square_module1 * square_module2); - - if (cosine >= 1.0f - SP_EPSYLON) { - return 0.0f; - } - - if (cosine <= -1.0f + SP_EPSYLON) { - return sp_get_half_circle(unit); - } - - return sp_convert_from_radians(acosf(cosine), unit); -} - -double dp_vector3_angle(const DPVector3* vector1, const DPVector3* vector2, const angle_unit_t unit) -{ - if (vector1 == 0 || vector2 == 0) { - return 0.0; - } - - const double square_module1 = dp_vector3_get_square_module(vector1); - - if (square_module1 <= DP_SQUARE_EPSYLON) { - return 0.0; - } - - const double square_module2 = dp_vector3_get_square_module(vector2); - - if (square_module2 <= DP_SQUARE_EPSYLON) { - return 0.0; - } - - const double cosine = dp_vector3_scalar(vector1, vector2) / sqrt(square_module1 * square_module2); - - if (cosine >= 1.0 - DP_EPSYLON) { - return 0.0; - } - - if (cosine <= -1.0 + DP_EPSYLON) { - return dp_get_half_circle(unit); - } - - return dp_convert_from_radians(acos(cosine), unit); -} +#include "vector3.h" + +const SPVector3 SP_ZERO_VECTOR3 = { 0.0f, 0.0f, 0.0f }; +const SPVector3 SP_X1_UNIT_VECTOR3 = { 1.0f, 0.0f, 0.0f }; +const SPVector3 SP_X2_UNIT_VECTOR3 = { 0.0f, 1.0f, 0.0f }; +const SPVector3 SP_X3_UNIT_VECTOR3 = { 0.0f, 0.0f, 1.0f }; + +const DPVector3 DP_ZERO_VECTOR3 = { 0.0, 0.0, 0.0 }; +const DPVector3 DP_X1_UNIT_VECTOR3 = { 1.0, 0.0, 0.0 }; +const DPVector3 DP_X2_UNIT_VECTOR3 = { 0.0, 1.0, 0.0 }; +const DPVector3 DP_X3_UNIT_VECTOR3 = { 0.0, 0.0, 1.0 }; + +// =================== Angle ==================== // + +float sp_vector3_angle(const SPVector3* vector1, const SPVector3* vector2, const angle_unit_t unit) +{ + if (vector1 == 0 || vector2 == 0) { + return 0.0f; + } + + const float square_module1 = sp_vector3_get_square_module(vector1); + + if (square_module1 <= SP_SQUARE_EPSYLON) { + return 0.0f; + } + + const float square_module2 = sp_vector3_get_square_module(vector2); + + if (square_module2 <= SP_SQUARE_EPSYLON) { + return 0.0f; + } + + const float cosine = sp_vector3_scalar(vector1, vector2) / sqrtf(square_module1 * square_module2); + + if (cosine >= 1.0f - SP_EPSYLON) { + return 0.0f; + } + + if (cosine <= -1.0f + SP_EPSYLON) { + return sp_get_half_circle(unit); + } + + return sp_convert_from_radians(acosf(cosine), unit); +} + +double dp_vector3_angle(const DPVector3* vector1, const DPVector3* vector2, const angle_unit_t unit) +{ + if (vector1 == 0 || vector2 == 0) { + return 0.0; + } + + const double square_module1 = dp_vector3_get_square_module(vector1); + + if (square_module1 <= DP_SQUARE_EPSYLON) { + return 0.0; + } + + const double square_module2 = dp_vector3_get_square_module(vector2); + + if (square_module2 <= DP_SQUARE_EPSYLON) { + return 0.0; + } + + const double cosine = dp_vector3_scalar(vector1, vector2) / sqrt(square_module1 * square_module2); + + if (cosine >= 1.0 - DP_EPSYLON) { + return 0.0; + } + + if (cosine <= -1.0 + DP_EPSYLON) { + return dp_get_half_circle(unit); + } + + return dp_convert_from_radians(acos(cosine), unit); +} diff --git a/src/vector3.h b/src/vector3.h index c907832..aa8d162 100644 --- a/src/vector3.h +++ b/src/vector3.h @@ -44,6 +44,22 @@ static inline void dp_vector3_reset(DPVector3* vector) vector->x3 = 0.0; } +// ==================== Set ===================== // + +static inline void sp_vector3_set_values(const float x1, const float x2, const float x3, SPVector3* to) +{ + to->x1 = x1; + to->x2 = x2; + to->x3 = x3; +} + +static inline void dp_vector3_set_values(const double x1, const double x2, const double x3, DPVector3* to) +{ + to->x1 = x1; + to->x2 = x2; + to->x3 = x3; +} + // ==================== Copy ==================== // static inline void sp_vector3_copy(const SPVector3* from, SPVector3* to) @@ -60,20 +76,52 @@ static inline void dp_vector3_copy(const DPVector3* from, DPVector3* to) to->x3 = from->x3; } -// ==================== Set ===================== // +// ============= Copy to twin type ============== // -static inline void sp_vector3_set(const float x1, const float x2, const float x3, SPVector3* to) +static inline void sp_vector3_copy_from_double(const DPVector3* from, SPVector3* to) { - to->x1 = x1; - to->x2 = x2; - to->x3 = x3; + to->x1 = (float)from->x1; + to->x2 = (float)from->x2; + to->x3 = (float)from->x3; } -static inline void dp_vector3_set(const double x1, const double x2, const double x3, DPVector3* to) +static inline void dp_vector3_copy_from_single(const SPVector3* from, DPVector3* to) { - to->x1 = x1; - to->x2 = x2; - to->x3 = x3; + to->x1 = from->x1; + to->x2 = from->x2; + to->x3 = from->x3; +} + +// =================== Reverse ================== // + +static inline void sp_vector3_reverse(const SPVector3* from, SPVector3* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; + to->x3 = -from->x3; +} + +static inline void dp_vector3_reverse(const DPVector3* from, DPVector3* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; + to->x3 = -from->x3; +} + +// ============= Reverse twin type ============== // + +static inline void sp_vector3_reverse_double(const DPVector3* from, SPVector3* to) +{ + to->x1 = -(float)from->x1; + to->x2 = -(float)from->x2; + to->x3 = -(float)from->x3; +} + +static inline void dp_vector3_reverse_single(const SPVector3* from, DPVector3* to) +{ + to->x1 = -from->x1; + to->x2 = -from->x2; + to->x3 = -from->x3; } // =================== Module =================== // @@ -124,54 +172,6 @@ static inline int dp_vector3_is_unit(const DPVector3* vector) return 1.0f - DP_TWO_EPSYLON <= square_module && square_module <= 1.0f + DP_TWO_EPSYLON; } -// ============= Copy to twin type ============== // - -static inline void sp_vector3_copy_to_double(const SPVector3* from, DPVector3* to) -{ - to->x1 = (double)from->x1; - to->x2 = (double)from->x2; - to->x3 = (double)from->x3; -} - -static inline void dp_vector3_copy_to_single(const DPVector3* from, SPVector3* to) -{ - to->x1 = (float)from->x1; - to->x2 = (float)from->x2; - to->x3 = (float)from->x3; -} - -// ================= Inversion ================== // - -static inline void sp_vector3_invert(SPVector3* vector) -{ - vector->x1 = -vector->x1; - vector->x2 = -vector->x2; - vector->x3 = -vector->x3; -} - -static inline void dp_vector3_invert(DPVector3* vector) -{ - vector->x1 = -vector->x1; - vector->x2 = -vector->x2; - vector->x3 = -vector->x3; -} - -// ================ Get Inverted ================ // - -static inline void sp_vector3_get_inverted(const SPVector3* vector, SPVector3* result) -{ - result->x1 = -vector->x1; - result->x2 = -vector->x2; - result->x3 = -vector->x3; -} - -static inline void dp_vector3_get_inverted(const DPVector3* vector, DPVector3* result) -{ - result->x1 = -vector->x1; - result->x2 = -vector->x2; - result->x3 = -vector->x3; -} - // ==================== Add ===================== // static inline void sp_vector3_add(const SPVector3* vector1, const SPVector3* vector2, SPVector3* result) diff --git a/src/versor.h b/src/versor.h index a450cd8..fa7361e 100644 --- a/src/versor.h +++ b/src/versor.h @@ -226,18 +226,7 @@ static inline int dp_versor_is_idle(const DPVersor* versor) // ============= Copy to twin type ============== // -static inline void sp_versor_copy_to_double(const SPVersor* versor, DPVersor* result) -{ - dp_versor_set( - (double)versor->_s0, - (double)versor->_x1, - (double)versor->_x2, - (double)versor->_x3, - result - ); -} - -static inline void dp_versor_copy_to_single(const DPVersor* versor, SPVersor* result) +static inline void sp_versor_from_double(const DPVersor* versor, SPVersor* result) { sp_versor_set( (float)versor->_s0, @@ -248,6 +237,17 @@ static inline void dp_versor_copy_to_single(const DPVersor* versor, SPVersor* re ); } +static inline void dp_versor_from_single(const SPVersor* versor, DPVersor* result) +{ + dp_versor_set( + (double)versor->_s0, + (double)versor->_x1, + (double)versor->_x2, + (double)versor->_x3, + result + ); +} + // ================= Inversion ================== // static inline void sp_versor_invert(SPVersor* versor) diff --git a/test/geometry-test.vcxproj b/test/geometry-test.vcxproj index 6ca000b..466a968 100644 --- a/test/geometry-test.vcxproj +++ b/test/geometry-test.vcxproj @@ -1,162 +1,162 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {48dae315-715f-4044-adf5-0308483b887c} - geometry-test - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)src;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {48dae315-715f-4044-adf5-0308483b887c} + geometry-test + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)src;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + {40ca6fb4-135f-4d54-a8d9-7338ba56e6a7} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/geometry-test.vcxproj.filters b/test/geometry-test.vcxproj.filters index 1e57359..d7e4b49 100644 --- a/test/geometry-test.vcxproj.filters +++ b/test/geometry-test.vcxproj.filters @@ -1,36 +1,36 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - Исходные файлы - - - Исходные файлы - - - - - Исходные файлы - - - Исходные файлы - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + Исходные файлы + + + Исходные файлы + + + + + Исходные файлы + + + Исходные файлы + + \ No newline at end of file diff --git a/test/geometry-test.vcxproj.user b/test/geometry-test.vcxproj.user index 88a5509..0f14913 100644 --- a/test/geometry-test.vcxproj.user +++ b/test/geometry-test.vcxproj.user @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file