diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1
index 7cbddd73..3bf9a65f 100644
Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.metadata.v5.1 differ
diff --git a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1
index e67c3eee..3fc06c50 100644
Binary files a/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 and b/源代码/.Net/.vs/ProjectEvaluation/stgsharp.projects.v5.1 differ
diff --git a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2
index af7f9cef..015c3819 100644
Binary files a/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 and b/源代码/.Net/.vs/StgSharp/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/153d1e9c-1d30-4cab-bcdf-d340a2f73f5c.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/153d1e9c-1d30-4cab-bcdf-d340a2f73f5c.vsidx
new file mode 100644
index 00000000..8b13f24a
Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/153d1e9c-1d30-4cab-bcdf-d340a2f73f5c.vsidx differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx
deleted file mode 100644
index f0e39f58..00000000
Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/5032e5c0-d80d-4d9c-9704-e366cb27caae.vsidx and /dev/null differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx
deleted file mode 100644
index 2640e2ce..00000000
Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/69c9e653-1f5d-44cc-82ea-990a5f897086.vsidx and /dev/null differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx
deleted file mode 100644
index bbca341f..00000000
Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/6e3a29d5-5d0c-4a86-ae19-9050f3f1b74f.vsidx and /dev/null differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/6fa79de4-a512-41fa-8073-d2e1db5def0e.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/6fa79de4-a512-41fa-8073-d2e1db5def0e.vsidx
new file mode 100644
index 00000000..ece4e210
Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/6fa79de4-a512-41fa-8073-d2e1db5def0e.vsidx differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/8967f140-5899-4311-8f69-03396e90e0d1.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/8967f140-5899-4311-8f69-03396e90e0d1.vsidx
new file mode 100644
index 00000000..0b42b631
Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/8967f140-5899-4311-8f69-03396e90e0d1.vsidx differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx
deleted file mode 100644
index 235ac695..00000000
Binary files a/源代码/.Net/.vs/StgSharp/FileContentIndex/afc162e6-e0e6-4720-ac47-1dad9aa6de0b.vsidx and /dev/null differ
diff --git a/源代码/.Net/.vs/StgSharp/FileContentIndex/cfbd5dd3-899e-4a0f-ada6-497219eadf9a.vsidx b/源代码/.Net/.vs/StgSharp/FileContentIndex/cfbd5dd3-899e-4a0f-ada6-497219eadf9a.vsidx
new file mode 100644
index 00000000..86015ddb
Binary files /dev/null and b/源代码/.Net/.vs/StgSharp/FileContentIndex/cfbd5dd3-899e-4a0f-ada6-497219eadf9a.vsidx differ
diff --git a/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 b/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2
index dd087324..025e8ad4 100644
Binary files a/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 and b/源代码/.Net/.vs/StgSharp/v17/.futdcache.v2 differ
diff --git a/源代码/.Net/.vs/StgSharp/v17/.suo b/源代码/.Net/.vs/StgSharp/v17/.suo
index c4fdb41d..5ec6a575 100644
Binary files a/源代码/.Net/.vs/StgSharp/v17/.suo and b/源代码/.Net/.vs/StgSharp/v17/.suo differ
diff --git a/源代码/.Net/StgSharp/Math/ASin.cs b/源代码/.Net/StgSharp/Math/ASin.cs
index b9d90dda..d10acf9c 100644
--- a/源代码/.Net/StgSharp/Math/ASin.cs
+++ b/源代码/.Net/StgSharp/Math/ASin.cs
@@ -53,7 +53,7 @@ namespace StgSharp.Math
if (transform)
{
r = 0.5f * (1.0f - y);
- s = StgSharp.Math.Sqrt(r);
+ s = Calc.Sqrt(r);
y = s;
}
else
@@ -90,90 +90,5 @@ namespace StgSharp.Math
return sign * v;
}
-
-
- ///
- /// Returns the angle whose sine is the quotient of two specified numbers.
- ///
- /// The x coordinate of a point.
- /// The y coordinate of a point.
- ///
- ///
- public static unsafe float ASin(float x, float y)
- {
- bool isXNeg = (x < 0);
- if (isXNeg)
- {
- x = -x;
- }
- float z = y /StgSharp.Math.Sqrt(x * x + y * y);
-
-
-
- int sign = 1;
- float t;
-
- if (z < 0)
- {
- sign = -1;
- t = -z;
- }
- else
- {
- t = z;
- }
-
- if (z > 1)
- {
- throw new ArgumentException();
- }
-
- float r, s, u, v = 0.0f;
- bool transform = (t >= 0.5f);
-
- if (transform)
- {
- r = 0.5f * (1.0f - t);
- s = StgSharp.Math.Sqrt(r);
- t = s;
- }
- else
- {
- r = t * t;
- }
- u = r * (0.184161606965100694821398249421F +
- (-0.0565298683201845211985026327361F +
- (-0.0133819288943925804214011424456F -
- 0.00396137437848476485201154797087F * r) * r) * r) /
- (1.10496961524520294485512696706F -
- 0.836411276854206731913362287293F * r);
- /**/
-
- if (transform)
- {
- float c, s1, p, q;
- uint us;
-
- us = *(uint*)&s;
- uint uss = us & 0xffff0000;
- s1 = *(float*)&uss;
-
- c = (r - s1 * s1) / (s + s1);
- p = 2.0F * s * u - (piby2_tail - 2.0F * c);
- q = hpiby2_head - 2.0F * s1;
- v = hpiby2_head - (p - q);
- }
- else
- {
- v = t + t * u;
- }/**/
-
- if (isXNeg)
- {
- v = piby2 - x;
- }
-
- return sign * v;
- }
}
}
diff --git a/源代码/.Net/StgSharp/Math/GetBits32.cs b/源代码/.Net/StgSharp/Math/GetBits32.cs
index 822d3489..2673c8c0 100644
--- a/源代码/.Net/StgSharp/Math/GetBits32.cs
+++ b/源代码/.Net/StgSharp/Math/GetBits32.cs
@@ -4,7 +4,7 @@ using System.Text;
namespace StgSharp.Math
{
- public static unsafe partial class calc
+ public static unsafe partial class Calc
{
///
diff --git a/源代码/.Net/StgSharp/Math/Log.cs b/源代码/.Net/StgSharp/Math/Log.cs
index 1e5ca743..50b5505e 100644
--- a/源代码/.Net/StgSharp/Math/Log.cs
+++ b/源代码/.Net/StgSharp/Math/Log.cs
@@ -6,7 +6,7 @@ using static System.Net.WebRequestMethods;
namespace StgSharp.Math
{
- public static partial class calc
+ public static partial class Calc
{
static private readonly float[] logArray =
diff --git a/源代码/.Net/StgSharp/Vector/Array2x2.cs b/源代码/.Net/StgSharp/Vector/Array2x2.cs
new file mode 100644
index 00000000..43b20bd4
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/Array2x2.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public struct Array2x2
+ {
+ public Vec2D row0;
+ public Vec2D row1;
+
+ public Vec2D colum0;
+ public Vec2D colum1;
+
+ public Array2x2(Vec2D c0, Vec2D c1)
+ {
+ row0 = c0;
+ row1 = c1;
+ colum0 = new Vec2D(c0.X,c1.X);
+ colum1 = new Vec2D(c0.Y,c1.Y);
+ }
+
+ public Array2x2(
+ float a11,
+ float a12,
+ float a21,
+ float a22
+ )
+ {
+ row0 = new Vec2D(a11, a12);
+ row1 = new Vec2D(a21, a22);
+
+ colum0 = new Vec2D(a11, a21);
+ colum1 = new Vec2D(a21, a22);
+ }
+
+ public static Array2x2 operator *(Array2x2 array1, Array2x2 array2)
+ {
+ return new Array2x2(
+ array1.colum0 * array2.row0,
+ array1.colum1 * array2.row0,
+ array1.colum0 * array2.row1,
+ array1.colum1 * array2.row1
+ );
+ }
+
+ public static Array2x2 operator +(Array2x2 array1, Array2x2 array2)
+ {
+ return new Array2x2(
+ array1.row0 + array2.row0,
+ array1.row1 + array2.row1
+ );
+ }
+
+ public static Array2x2 operator -(Array2x2 array1, Array2x2 array2)
+ {
+ return new Array2x2(
+ array1.row0 - array2.row0,
+ array1.row1 - array2.row1
+ );
+ }
+
+
+
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/Array3x3.cs b/源代码/.Net/StgSharp/Vector/Array3x3.cs
new file mode 100644
index 00000000..4e5909f3
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/Array3x3.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public struct Array3x3
+ {
+ public Vec3D row0;
+ public Vec3D row1;
+ public Vec3D row2;
+
+ public Vec3D colum0;
+ public Vec3D colum1;
+ public Vec3D colum2;
+
+ public Array3x3(Vec3D r0,Vec3D r1,Vec3D r2)
+ {
+ row0 = r0;
+ row1 = r1;
+ row2 = r2;
+
+ colum0 = new Vec3D(r0.X, r1.X, r2.X);
+ colum1 = new Vec3D(r0.Y, r1.Y, r2.Y);
+ colum2 = new Vec3D(r0.Z, r1.Z, r2.Z);
+ }
+
+ public Array3x3(
+ float a11,float a12,float a13,
+ float a21,float a22,float a23,
+ float a31,float a32,float a33
+ )
+ {
+ row0 = new Vec3D(a11, a12, a13);
+ row1 = new Vec3D(a21, a22, a23);
+ row2 = new Vec3D(a31, a32, a33);
+
+ colum0 = new Vec3D(a11,a21,a31);
+ colum1 = new Vec3D(a12,a22,a32);
+ colum2 = new Vec3D(a13,a23,a33);
+ }
+
+ public static Array3x3 operator +(Array3x3 array1, Array3x3 array2)
+ {
+ return new Array3x3(
+ array1.row0.X + array2.row0.X,
+ array1.row0.Y + array2.row0.Y,
+ array1.row0.Z + array2.row0.Z,
+
+ array1.row1.X + array2.row1.X,
+ array1.row1.Y + array2.row1.Y,
+ array1.row1.Z + array2.row1.Z,
+
+ array1.row2.X + array2.row2.X,
+ array1.row2.Y + array2.row2.Y,
+ array1.row2.Z + array2.row2.Z
+ );
+ }
+
+ public static Array3x3 operator -(Array3x3 array1, Array3x3 array2)
+ {
+ return new Array3x3(
+ array1.row0.X - array2.row0.X,
+ array1.row0.Y - array2.row0.Y,
+ array1.row0.Z - array2.row0.Z,
+
+ array1.row1.X - array2.row1.X,
+ array1.row1.Y - array2.row1.Y,
+ array1.row1.Z - array2.row1.Z,
+
+ array1.row2.X - array2.row2.X,
+ array1.row2.Y - array2.row2.Y,
+ array1.row2.Z - array2.row2.Z
+ );
+ }
+
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/Cross.cs b/源代码/.Net/StgSharp/Vector/Cross.cs
new file mode 100644
index 00000000..bdd10140
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/Cross.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public static unsafe partial class VectorCalc
+ {
+
+ public static float Cross(Vec2D vec1, Vec2D vec2)
+ {
+ return vec1.X * vec2.Y - vec1.Y * vec2.X;
+ }
+
+ public static Vec3D Cross(Vec3D vec1, Vec3D vec2)
+ {
+ return new Vec3D(
+ vec1.Y * vec2.Z - vec1.Z * vec2.Y,
+ vec1.X * vec2.Z - vec1.Z * vec2.X,
+ vec1.X * vec2.Y - vec1.Y * vec2.X
+ );
+ }
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/Det.cs b/源代码/.Net/StgSharp/Vector/Det.cs
new file mode 100644
index 00000000..882f23d9
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/Det.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public static unsafe partial class VectorCalc
+ {
+
+ public static float Det(Array2x2 array)
+ {
+ return Cross(array.row0,array.row1);
+ }
+
+ public static float Det(Array3x3 array)
+ {
+ return 0;
+ }
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/GetAngle.cs b/源代码/.Net/StgSharp/Vector/GetAngle.cs
new file mode 100644
index 00000000..c6eea97a
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/GetAngle.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public static unsafe partial class VectorCalc
+ {
+ public static float GetAngle(Vec2D vec1, Vec2D vec2)
+ {
+ return Calc.ACos(
+ vec1 * vec2
+ / (vec1.GetLength() * vec2.GetLength())
+ );
+ }
+
+ public static float GetAngle(Vec3D vec1, Vec3D vec2)
+ {
+ return Calc.ACos(
+ vec1 * vec2
+ / (vec1.GetLength() * vec2.GetLength())
+ );
+ }
+
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/GetLength.cs b/源代码/.Net/StgSharp/Vector/GetLength.cs
new file mode 100644
index 00000000..5bcda830
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/GetLength.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public static unsafe partial class VectorCalc
+ {
+ public static float GetLength(this Vec3D vec)
+ {
+ return Calc.Sqrt(
+ vec.X * vec.X +
+ vec.Y * vec.Y +
+ vec.Z * vec.Z
+ );
+ }
+
+ public static float GetLength(this Vec2D vec)
+ {
+ return Calc.Sqrt(
+ vec.X * vec.X +
+ vec.Y * vec.Y
+ );
+ }
+
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/Multiple.cs b/源代码/.Net/StgSharp/Vector/Multiple.cs
new file mode 100644
index 00000000..0647499a
--- /dev/null
+++ b/源代码/.Net/StgSharp/Vector/Multiple.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace StgSharp.Math
+{
+ public static unsafe partial class VectorCalc
+ {
+ public static Array2x2
+
+ }
+}
diff --git a/源代码/.Net/StgSharp/Vector/Vec2D.cs b/源代码/.Net/StgSharp/Vector/Vec2D.cs
index 0b21d28a..9c171b17 100644
--- a/源代码/.Net/StgSharp/Vector/Vec2D.cs
+++ b/源代码/.Net/StgSharp/Vector/Vec2D.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
+using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Math
@@ -9,15 +10,11 @@ namespace StgSharp.Math
{
public float X;
public float Y;
- public float Direction;
- public float Length;
public Vec2D(float x,float y)
{
X = x;
Y = y;
- Direction = Calc.ATan(X,Y);
- Length = Calc.Sqrt(X * X + Y * Y);
}
public bool Equals(Vec2D other)
@@ -93,10 +90,9 @@ namespace StgSharp.Math
return new Vec2D(vec.X/x, vec.Y/x);
}
- public float x(Vec2D others)
+ public Vec3D to3D()
{
- return this.X * others.Y - this.Y * others.X;
+ return new Vec3D(this.X, this.Y, 0.0f);
}
-
}
}
diff --git a/源代码/.Net/StgSharp/Vector/Vec3D.cs b/源代码/.Net/StgSharp/Vector/Vec3D.cs
index 2e179fe4..9e0f60ba 100644
--- a/源代码/.Net/StgSharp/Vector/Vec3D.cs
+++ b/源代码/.Net/StgSharp/Vector/Vec3D.cs
@@ -90,6 +90,14 @@ namespace StgSharp.Math
);
}
+ public static float operator *(Vec3D vec1, Vec3D vec2)
+ {
+ return
+ vec1.X * vec2.X
+ + vec1.Y + vec2.Y
+ + vec1.Z + vec2.Z;
+ }
+
public static Vec3D operator *(Vec3D vec, float x)
{
return new Vec3D(
@@ -107,6 +115,5 @@ namespace StgSharp.Math
vec.Z / x
);
}
-
}
}