docs: vector3d rotate parameters updated

This commit is contained in:
2025-10-19 00:12:35 +03:00
parent 9d2a192f04
commit c5afb70b18

View File

@@ -198,13 +198,13 @@ public readonly struct Vector3D(float x, float y, float z) : IEquatable<Vector3D
public static Vector3D Scale(Vector3D vector, Vector3D scale) => new(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z); public static Vector3D Scale(Vector3D vector, Vector3D scale) => new(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z);
/// <summary> /// <summary>
/// Rotates a <see cref="Vector3D"/> around a normal by the specified angle (in radians). /// Rotates a <see cref="Vector3D"/> around a axis by the specified angle (in radians).
/// </summary> /// </summary>
/// <param name="vector">The <see cref="Vector3D"/> to rotate.</param> /// <param name="vector">The <see cref="Vector3D"/> to rotate.</param>
/// <param name="normal">The <see cref="Vector3D"/> to rotate around.</param> /// <param name="axis">The <see cref="Vector3D"/> to rotate around.</param>
/// <param name="angleInRadian">The angle to rotate by, in radians.</param> /// <param name="angleInRadian">The angle to rotate by, in radians.</param>
/// <returns>The rotated <see cref="Vector3D"/>.</returns> /// <returns>The rotated <see cref="Vector3D"/>.</returns>
public static Vector3D Rotate(Vector3D vector, Vector3D normal, float angleInRadian) => vector * Math.Cos(angleInRadian) + Cross(normal, vector) * Math.Sin(angleInRadian) + normal * Dot(normal, vector) * (1f - Math.Cos(angleInRadian)); public static Vector3D Rotate(Vector3D vector, Vector3D axis, float angleInRadian) => vector * Math.Cos(angleInRadian) + Cross(axis, vector) * Math.Sin(angleInRadian) + axis * Dot(axis, vector) * (1f - Math.Cos(angleInRadian));
/// <summary> /// <summary>
/// Returns the component-wise minimum of two <see cref="Vector3D"/>s. /// Returns the component-wise minimum of two <see cref="Vector3D"/>s.