예제 #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;
 }