示例#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;
 }