/// <summary> /// /// </summary> /// <param name="eye"></param> /// <param name="target"></param> /// <param name="up"></param> /// <returns></returns> public static Orient3d CreateLookAt(Vec3d eye, Vec3d target, Vec3d up) { var rot = new Rotation3d(target - eye, up); rot.SwapZX(); var orient = new Orient3d(rot, eye); orient.Invert(); return(orient); }
/// <summary> /// /// </summary> /// <param name="r0"></param> /// <param name="r1"></param> public static Rotation3d CreateRelative(ref Rotation3d r0, ref Rotation3d r1) { return(r1.Apply(r0.Inverse)); }
/// <summary> /// Creates a relative rotation from r0 to r1. /// </summary> /// <param name="r0"></param> /// <param name="r1"></param> /// <returns></returns> public static Rotation3d CreateRelative(Rotation3d r0, Rotation3d r1) { return(CreateRelative(ref r0, ref r1)); }
/// <summary> /// /// </summary> /// <param name="r0"></param> /// <param name="r1"></param> public static Rotation3d Multiply(ref Rotation3d r0, ref Rotation3d r1) { return(r0.Apply(r1)); }
/// <summary> /// /// </summary> /// <param name="rotation"></param> /// <param name="vector"></param> public static Vec3d Multiply(ref Rotation3d rotation, Vec3d vector) { return(rotation.Apply(vector)); }
/// <summary> /// Applies the inverse of this rotation to the given rotation. /// </summary> /// <param name="other"></param> /// <returns></returns> public Rotation3d ApplyInverse(Rotation3d other) { other.SetXY(ApplyInverse(other._x), ApplyInverse(other._y)); return(other); }
/// <summary> /// /// </summary> /// <param name="scale"></param> /// <param name="orientation"></param> public Transform3d(Vec3d scale, Orient3d orientation) { Scale = scale; Rotation = orientation.Rotation; Translation = orientation.Translation; }
/// <summary> /// /// </summary> /// <param name="scale"></param> /// <param name="rotation"></param> /// <param name="translation"></param> public Transform3d(Vec3d scale, Rotation3d rotation, Vec3d translation) { Scale = scale; Rotation = rotation; Translation = translation; }
/// <summary> /// /// </summary> /// <param name="origin"></param> /// <param name="x"></param> /// <param name="y"></param> public Orient3d(Vec3d origin, Vec3d x, Vec3d y) { Rotation = new Rotation3d(x, y); Translation = origin; }
/// <summary> /// /// </summary> /// <param name="rotation"></param> /// <param name="translation"></param> public Orient3d(Rotation3d rotation, Vec3d translation) { Rotation = rotation; Translation = translation; }
/// <summary> /// Applies the inverse of this rotation to the given rotation. /// </summary> /// <param name="other"></param> /// <returns></returns> public void ApplyInverse(ref Rotation3d other) { other.SetXY(ApplyInverse(other._x), ApplyInverse(other._y)); }
/// <summary> /// Applies the inverse of this rotation to the given rotation. /// </summary> /// <param name="other"></param> /// <returns></returns> public Rotation3d ApplyInverse(Rotation3d other) { ApplyInverse(ref other); return(other); }
/// <summary> /// Applies this rotation to the given rotation. /// </summary> /// <param name="other"></param> /// <returns></returns> public Rotation3d Apply(Rotation3d other) { Apply(ref other); return(other); }
/// <summary> /// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm /// </summary> /// <param name="rotation"></param> public AxisAngle3d(ref Rotation3d rotation) : this() { throw new NotImplementedException(); }