# Vector3d struct

Namespace: [Rhino.Geometry](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.geometry.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 24)]
[DebuggerDisplay("({m_x}, {m_y}, {m_z})")]
[Serializable]
public struct Vector3d : ISerializable, IEquatable<Vector3d>, IComparable<Vector3d>, IComparable, IEpsilonComparable<Vector3d>, ICloneable, IFormattable
```

Represents the three components of a vector in three-dimensional space, using [double](https://learn.microsoft.com/dotnet/api/system.double)-precision floating point numbers.

## Constructors

- [Vector3d](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/ctor.md): (4 overloads) Initializes a new instance of a vector, using its three components.

## Properties

- [IsUnitVector](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/isunitvector.md): Gets a value indicating whether or not this is a unit vector. A unit vector has length 1.
- [IsValid](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/isvalid.md): Gets a value indicating whether this vector is valid. A valid vector must be formed of valid component values for x, y and z.
- [IsZero](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/iszero.md): Gets a value indicating whether the X, Y, and Z values are all equal to 0.0.
- [Length](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/length.md): Computes the length (or magnitude, or size) of this vector. This is an application of Pythagoras' theorem. If this vector is invalid, its length is considered 0.
- [MaximumCoordinate](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/maximumcoordinate.md): Gets the largest (both positive and negative) component value in this vector, as an absolute value.
- [MinimumCoordinate](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/minimumcoordinate.md): Gets the smallest (both positive and negative) component value in this vector.
- [SquareLength](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/squarelength.md): Computes the squared length (or magnitude, or size) of this vector. This is an application of Pythagoras' theorem. While the Length property checks for input validity, this property does not. You should check validity in advance, if this vector can be invalid.
- [Unset](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/unset.md): (static) Gets the value of the vector with each component set to RhinoMath.UnsetValue.
- [X](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/x.md): Gets or sets the X (first) component of the vector.
- [XAxis](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/xaxis.md): (static) Gets the value of the vector with components 1,0,0.
- [Y](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/y.md): Gets or sets the Y (second) component of the vector.
- [YAxis](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/yaxis.md): (static) Gets the value of the vector with components 0,1,0.
- [Z](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/z.md): Gets or sets the Z (third) component of the vector.
- [ZAxis](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/zaxis.md): (static) Gets the value of the vector with components 0,0,1.
- [Zero](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/zero.md): (static) Gets the value of the vector with components 0,0,0.

## Indexers

- [this[]](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/item.md): Gets or sets a vector component at the given index.

## Methods

- [Add](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/add.md): (static) Sums up two vectors. (Provided for languages that do not support operator overloading. You can use the + operator otherwise)
- [AreOrthogonal](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/areorthogonal.md): (static) Test whether three vectors describe an orthogonal axis system. All vectors must be mutually perpendicular this to be the case.
- [AreOrthonormal](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/areorthonormal.md): (static) Test whether three vectors describe an orthogonal, unit axis system. All vectors must be mutually perpendicular and have unit length for this to be the case.
- [AreRighthanded](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/arerighthanded.md): (static) Test whether three vectors describe a right-handed, orthogonal, unit axis system. The vectors must be orthonormal and follow the right-hand ordering; index-finger=x, middle-finger=y, thumb=z.
- [CompareTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/compareto.md): Compares this [Vector3d](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d.md) with another [Vector3d](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d.md). Component evaluation priority is first X, then Y, then Z.
- [CrossProduct](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/crossproduct.md): (static) Computes the cross product (or vector product, or exterior product) of two vectors. This operation is not commutative.
- [Decompose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/decompose.md): (static) Find scalars x and y so that the component of v in the plane of a and b is x*a + y*b
- [Divide](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/divide.md): (static) Divides a [Vector3d](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d.md) by a number, having the effect of shrinking it. (Provided for languages that do not support operator overloading. You can use the / operator otherwise)
- [EpsilonEquals](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/epsilonequals.md): Check that all values in other are within epsilon of the values in this
- [Equals](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/equals.md): (2 overloads) Determines whether the specified System.Object is a Vector3d and has the same values as the present vector.
- [GetHashCode](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/gethashcode.md): Computes the hash code for the current vector.
- [IsParallelTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/isparallelto.md): (2 overloads) Determines whether this vector is parallel to another vector, within a provided tolerance.
- [IsPerpendicularTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/isperpendicularto.md): (2 overloads) Determines whether this vector is perpendicular to another vector, within a provided angle tolerance.
- [IsTiny](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/istiny.md): (2 overloads) Uses RhinoMath.ZeroTolerance for IsTiny calculation.
- [Multiply](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/multiply.md): (3 overloads, static) Multiplies two vectors together, returning the dot product (or inner product). This differs from the cross product. (Provided for languages that do not support operator overloading. You can use the * operator otherwise)
- [Negate](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/negate.md): (static) Computes the reversed vector. (Provided for languages that do not support operator overloading. You can use the - unary operator otherwise)
- [PerpendicularTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/perpendicularto.md): (2 overloads) Set this vector to be perpendicular to a plane defined by 3 points.
- [Reverse](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/reverse.md): Reverses this vector in place (reverses the direction). If this vector is Invalid, no changes will occur and false will be returned.
- [Rotate](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/rotate.md): Rotates this vector around a given axis.
- [Subtract](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/subtract.md): (static) Subtracts the second vector from the first one. (Provided for languages that do not support operator overloading. You can use the - operator otherwise)
- [ICloneable.Clone](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/system-icloneable-clone.md)
- [IComparable.CompareTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/system-icomparable-compareto.md)
- [ISerializable.GetObjectData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/system-runtime-serialization-iserializable-getobjectdata.md)
- [ToString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/tostring.md): (2 overloads) Returns the string representation of the current vector, in the form X,Y,Z.
- [Transform](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/transform.md): Transforms the vector in place. The transformation matrix acts on the left of the vector; i.e., result = transformation*vector
- [Unitize](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/unitize.md): Unitizes the vector in place. A unit vector has length 1 unit. An invalid or zero length vector cannot be unitized.
- [VectorAngle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/vectorangle.md): (3 overloads, static) Computes the angle on a plane between two vectors.

## Operators

- [operator +](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-addition.md): (static) Sums up two vectors.
- [operator /](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-division.md): (static) Divides a [Vector3d](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d.md) by a number, having the effect of shrinking it.
- [operator ==](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-equality.md): (static) Determines whether two vectors have the same value.
- [operator >](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-greaterthan.md): (static) Determines whether the first specified vector comes after (has superior sorting value than) the second vector. Components evaluation priority is first X, then Y, then Z.
- [operator >=](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-greaterthanorequal.md): (static) Determines whether the first specified vector comes after (has superior sorting value than) the second vector, or it is equal to it. Components evaluation priority is first X, then Y, then Z.
- [operator !=](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-inequality.md): (static) Determines whether two vectors have different values.
- [operator <](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-lessthan.md): (static) Determines whether the first specified vector comes before (has inferior sorting value than) the second vector. Components evaluation priority is first X, then Y, then Z.
- [operator <=](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-lessthanorequal.md): (static) Determines whether the first specified vector comes before (has inferior sorting value than) the second vector, or it is equal to it. Components evaluation priority is first X, then Y, then Z.
- [operator *](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-multiply.md): (3 overloads, static) Multiplies two vectors together, returning the dot product (or inner product). This differs from the cross product.
- [operator -](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-subtraction.md): (static) Subtracts the second vector from the first one.
- [operator -](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-unarynegation.md): (static) Computes the opposite vector.

## Convertors

- [operator implicit](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.vector3d/op-implicit.md): (static) Converts a single-precision (float) vector in a double-precision vector, without needing casting.
