/// <summary> /// Calculates the angle between the specified points. /// </summary> /// <param name="center">The center of the angle.</param> /// <param name="start">The start of the angle.</param> /// <param name="end">The end of the angle.</param> /// <returns>The angle, in degrees.</returns> public static double Angle(this DepthSpacePoint center, DepthSpacePoint start, DepthSpacePoint end) { Vector3 first = start.ToVector3() - center.ToVector3(); Vector3 second = end.ToVector3() - center.ToVector3(); return(Vector3.Angle(first, second)); }
/// <summary> /// Calculates the angle and updates the arc according to the specifed points. /// </summary> /// <param name="start">The starting point.</param> /// <param name="middle">The middle point.</param> /// <param name="end">The end point.</param> /// <param name="desiredRadius">The desired arc radius.</param> public void Update(DepthSpacePoint start, DepthSpacePoint middle, DepthSpacePoint end, double desiredRadius = 0) { Update(start.ToVector3(), middle.ToVector3(), end.ToVector3(), desiredRadius); }
/// <summary> /// Calculates the angle between the specified points. /// </summary> /// <param name="center">The center of the angle.</param> /// <param name="start">The start of the angle.</param> /// <param name="end">The end of the angle.</param> /// <returns>The angle, in degrees.</returns> public static double Angle(this DepthSpacePoint center, DepthSpacePoint start, DepthSpacePoint end) { Vector3D first = start.ToVector3() - center.ToVector3(); Vector3D second = end.ToVector3() - center.ToVector3(); return Vector3D.AngleBetween(first, second); }