/// <summary> /// Rotate the current vector around a specified vector from a defined angle in radians. /// </summary> /// <param name="v">Vector used as a rotation axis.</param> /// <param name="theta">Angle of rotation expressed in radians.</param> /// <returns>The coordinates of the resulting rotated vector.</returns> public SphericalVector RotateAround(SphericalVector v, double theta) { if (theta.IsZero()) { return(this); } return(CoordinateConverter.ConvertToSpherical(CoordinateConverter.ConvertToCartesian(this).RotateAroundVector(CoordinateConverter.ConvertToCartesian(v), theta))); }
/// <summary> /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. /// </summary> /// <param name="x">The first object to compare.</param> /// <param name="y">The second object to compare.</param> /// <returns> /// A signed integer that indicates the relative values of x and y: /// - If less than 0, x is less than y. /// - If 0, x equals y. /// - If greater than 0, x is greater than y. /// </returns> public int Compare(SphericalVector x, SphericalVector y) { return(this.Compare(CoordinateConverter.ConvertToCartesian(x), CoordinateConverter.ConvertToCartesian(y))); }