コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="p0"></param>
 /// <param name="p1"></param>
 public static Orient2d CreateFromPoints(Vec2d p0, Vec2d p1)
 {
     return(new Orient2d(p0, p1 - p0));
 }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rotation"></param>
 /// <param name="translation"></param>
 public Orient2d(OrthoBasis2d rotation, Vec2d translation)
 {
     Rotation    = rotation;
     Translation = translation;
 }
コード例 #3
0
 /// <summary>
 /// Applies the inverse of this transformation to the given point.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public Vec2d ApplyInverse(Vec2d point)
 {
     return(Rotation.ApplyInverse(point - Translation));
 }
コード例 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="z"></param>
 public void Deconstruct(out OrthoBasis2d rotation, out Vec2d translation)
 {
     rotation    = Rotation;
     translation = Translation;
 }
コード例 #5
0
 /// <summary>
 /// Inverts this transformation in place.
 /// </summary>
 public void Invert()
 {
     Rotation.Invert();
     Translation = -Rotation.Apply(Translation);
 }
コード例 #6
0
 /// <summary>
 /// Applies this transformation to the given point.
 /// </summary>
 /// <param name="point"></param>
 /// <returns></returns>
 public Vec2d Apply(Vec2d point)
 {
     return(Rotation.Apply(point) + Translation);
 }
コード例 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cosAngle"></param>
 /// <param name="sinAngle"></param>
 private Rotation2d(double cosAngle, double sinAngle)
 {
     _x = new Vec2d(cosAngle, sinAngle);
 }
コード例 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="origin"></param>
 /// <param name="x"></param>
 public Orient2d(Vec2d origin, Vec2d x)
 {
     Rotation    = new OrthoBasis2d(x);
     Translation = origin;
 }
コード例 #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="x"></param>
 public Rotation2d(Vec2d x)
 {
     _x = x.Unit;
 }
コード例 #10
0
 /// <summary>
 /// Applies the inverse of this rotation to the given vector.
 /// </summary>
 /// <param name="vector"></param>
 /// <returns></returns>
 public Vec2d ApplyInverse(Vec2d vector)
 {
     return(new Vec2d(Vec2d.Dot(vector, X), Vec2d.Dot(vector, Y)));
 }
コード例 #11
0
 /// <summary>
 /// Applies this rotation to the given vector.
 /// </summary>
 /// <param name="vector"></param>
 /// <returns></returns>
 public Vec2d Apply(Vec2d vector)
 {
     return(vector.X * X + vector.Y * Y);
 }
コード例 #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="angle"></param>
 public void Set(double angle)
 {
     _x = new Vec2d(Math.Cos(angle), Math.Sin(angle));
 }
コード例 #13
0
ファイル: Vec3d.cs プロジェクト: GitZHCODE/zCode
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="z"></param>
 public Vec3d(Vec2d other, double z)
 {
     X = other.X;
     Y = other.Y;
     Z = z;
 }