1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-10 05:15:42 +00:00

Use in parameters for Vector3d static methods

This commit is contained in:
Oliver Booth 2022-11-30 18:38:13 +00:00
parent 17e3795eeb
commit f640d5e999
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -118,7 +118,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The first source vector.</param> /// <param name="left">The first source vector.</param>
/// <param name="right">The second source vector.</param> /// <param name="right">The second source vector.</param>
/// <returns>The summed vector.</returns> /// <returns>The summed vector.</returns>
public static Vector3d operator +(Vector3d left, Vector3d right) public static Vector3d operator +(in Vector3d left, in Vector3d right)
{ {
return new( return new(
left.X + right.X, left.X + right.X,
@ -133,7 +133,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The first source vector.</param> /// <param name="left">The first source vector.</param>
/// <param name="right">The second source vector.</param> /// <param name="right">The second source vector.</param>
/// <returns>The difference vector.</returns> /// <returns>The difference vector.</returns>
public static Vector3d operator -(Vector3d left, Vector3d right) public static Vector3d operator -(in Vector3d left, in Vector3d right)
{ {
return new( return new(
left.X - right.X, left.X - right.X,
@ -148,7 +148,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The first source vector.</param> /// <param name="left">The first source vector.</param>
/// <param name="right">The second source vector.</param> /// <param name="right">The second source vector.</param>
/// <returns>The product vector.</returns> /// <returns>The product vector.</returns>
public static Vector3d operator *(Vector3d left, Vector3d right) public static Vector3d operator *(in Vector3d left, in Vector3d right)
{ {
return new( return new(
left.X * right.X, left.X * right.X,
@ -163,7 +163,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The vector value.</param> /// <param name="left">The vector value.</param>
/// <param name="right">The scalar value.</param> /// <param name="right">The scalar value.</param>
/// <returns>The scaled vector.</returns> /// <returns>The scaled vector.</returns>
public static Vector3d operator *(Vector3d left, double right) public static Vector3d operator *(in Vector3d left, double right)
{ {
return new( return new(
left.X * right, left.X * right,
@ -178,7 +178,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The scalar value.</param> /// <param name="left">The scalar value.</param>
/// <param name="right">The vector value.</param> /// <param name="right">The vector value.</param>
/// <returns>The scaled vector.</returns> /// <returns>The scaled vector.</returns>
public static Vector3d operator *(double left, Vector3d right) public static Vector3d operator *(double left, in Vector3d right)
{ {
return new( return new(
left * right.X, left * right.X,
@ -193,7 +193,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The first source vector.</param> /// <param name="left">The first source vector.</param>
/// <param name="right">The second source vector.</param> /// <param name="right">The second source vector.</param>
/// <returns>The vector resulting from the division.</returns> /// <returns>The vector resulting from the division.</returns>
public static Vector3d operator /(Vector3d left, Vector3d right) public static Vector3d operator /(in Vector3d left, in Vector3d right)
{ {
return new( return new(
left.X / right.X, left.X / right.X,
@ -208,7 +208,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// <param name="left">The vector value.</param> /// <param name="left">The vector value.</param>
/// <param name="right">The scalar value.</param> /// <param name="right">The scalar value.</param>
/// <returns>The vector resulting from the division.</returns> /// <returns>The vector resulting from the division.</returns>
public static Vector3d operator /(Vector3d left, double right) public static Vector3d operator /(in Vector3d left, double right)
{ {
return new( return new(
left.X / right, left.X / right,
@ -222,7 +222,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// </summary> /// </summary>
/// <param name="value">The source vector.</param> /// <param name="value">The source vector.</param>
/// <returns>The negated vector.</returns> /// <returns>The negated vector.</returns>
public static Vector3d operator -(Vector3d value) public static Vector3d operator -(in Vector3d value)
{ {
return Zero - value; return Zero - value;
} }
@ -276,7 +276,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// </summary> /// </summary>
/// <param name="value">The source vector.</param> /// <param name="value">The source vector.</param>
/// <returns>The absolute value vector.</returns> /// <returns>The absolute value vector.</returns>
public static Vector3d Abs(Vector3d value) public static Vector3d Abs(in Vector3d value)
{ {
return new( return new(
Math.Abs(value.X), Math.Abs(value.X),
@ -433,7 +433,7 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
/// </summary> /// </summary>
/// <param name="value">The source vector.</param> /// <param name="value">The source vector.</param>
/// <returns>The square root vector.</returns> /// <returns>The square root vector.</returns>
public static Vector3d SquareRoot(Vector3d value) public static Vector3d SquareRoot(in Vector3d value)
{ {
return new( return new(
Math.Sqrt(value.X), Math.Sqrt(value.X),