Skip to content

Vector3f

Public Struct

Represents the three components of a vector in three-dimensional space, using Single-precision floating point numbers.

Namespace: Rhino.Geometry

Assembly: RhinoCommon (in RhinoCommon.dll)

Syntax

[SerializableAttribute]
public struct Vector3f : IEquatable<Vector3f>,
IComparable<Vector3f>, IComparable, IEpsilonFComparable<Vector3f>,
IFormattable

The Vector3f type exposes the following members.

Constructors

Name

Description


Public Method

Constructs a new vector from 3 single precision numbers.


Properties

Name

Description


Public Property

Gets a value indicating whether or not this is a unit vector. A unit vector has length 1.


Public Property

Returns an indication regarding the validity of this vector.


Public Property

Gets a value indicating whether the X, Y, and Z values are all equal to 0.0.


Public Property

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.


Public Property

Returns the square length of the vector. This property does not check for the validity of the inputs.


Public Property
Static Member

Gets the value of the vector with each component set to RhinoMath.UnsetValue.


Public Property

Gets or sets the X (first) component of this vector.


Public Property
Static Member

Gets the value of the vector with components 1,0,0.


Public Property

Gets or sets the Y (second) component of this vector.


Public Property
Static Member

Gets the value of the vector with components 0,1,0.


Public Property

Gets or sets the Z (third) component of this vector.


Public Property
Static Member

Gets the value of the vector with components 0,0,1.


Public Property
Static Member

Gets the value of the vector with components 0,0,0.


Methods

Name

Description


Public Method
Static Member

Sums up a point and a vector, and returns a new point.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)


Public Method
Static Member

Sums up two vectors.

(Provided for languages that do not support operator overloading. You can use the + operator otherwise)


Public Method

Compares this Vector3f with another Vector3f.

Component evaluation priority is first X, then Y, then Z.


Public Method
Static Member

Computes the cross product (or vector product, or exterior product) of two vectors.

This operation is not commutative.


Public Method
Static Member

Divides a Vector3f by a number, having the effect of shrinking it, t times.

(Provided for languages that do not support operator overloading. You can use the / operator otherwise)


Public Method
Static Member

Divides a Vector3f by a number, having the effect of shrinking it, t times.

(Provided for languages that do not support operator overloading. You can use the / operator otherwise)


Public Method

Check that all values in other are within epsilon of the values in this


Public Method

Determines whether the specified System.Object is a Vector3f and has the same values as the present vector.

(Overrides ValueType.Equals(Object).)


Public Method

Determines whether the specified vector has the same values as the present vector.


Public Method

Computes a hash number that represents the current vector.

(Overrides ValueType.GetHashCode..)


Public Method

GetType

Gets the Type of the current instance.

(Inherited from Object.)


Public Method
Static Member

Multiplies a vector by a number, having the effect of scaling it.

(Provided for languages that do not support operator overloading. You can use the * operator otherwise)


Public Method
Static Member

Multiplies two Vector3f together, returning the dot (internal) product of the two. This is not the cross product.

(Provided for languages that do not support operator overloading. You can use the * operator otherwise)


Public Method
Static Member

Multiplies a vector by a number, having the effect of scaling it.

(Provided for languages that do not support operator overloading. You can use the * operator otherwise)


Public Method
Static Member
Negate

Computes the reversed vector.

(Provided for languages that do not support operator overloading. You can use the - unary operator otherwise)


Public Method

Sets this vector to be perpendicular to another vector. Result is not unitized.


Public Method
Reverse

Reverses this vector in place (reverses the direction).

If this vector contains RhinoMath.UnsetValue, the reverse will also be invalid and false will be returned.


Public Method

Rotates this vector around a given axis.


Public Method
Static Member

Subtracts the second vector from the first one.

(Provided for languages that do not support operator overloading. You can use the - operator otherwise)


Public Method

Constructs the string representation of the current vector.

(Overrides ValueType.ToString..)


Public Method

Formats the value of the current instance using the specified format.


Public Method

Transforms the vector in place.

The transformation matrix acts on the left of the vector; i.e.,

result = transformation*vector


Public Method

Unitizes the vector in place. A unit vector has length 1 unit.

An invalid or zero length vector cannot be unitized.


Operators

Name

Description


Public Operator
Static Member
Addition(Point3f, Vector3f)

Sums up a point and a vector, and returns a new point.


Public Operator
Static Member
Addition(Vector3f, Vector3f)

Sums up two vectors.


Public Operator
Static Member
Division(Vector3f, Double)

Divides a Vector3f by a number, having the effect of shrinking it, t times.


Public Operator
Static Member
Division(Vector3f, Single)

Divides a Vector3f by a number, having the effect of shrinking it, t times.


Public Operator
Static Member
Equality

Determines whether two vectors have equal values.


Public Operator
Static Member
.(Vector3d to Vector3f)

Converts a double-precision vector in a single-precision vector. Needs explicit casting to help retain precision.


Public Operator
Static Member
GreaterThan

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.


Public Operator
Static Member
GreaterThanOrEqual

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.


Public Operator
Static Member
Inequality

Determines whether two vectors have different values.


Public Operator
Static Member
LessThan

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.


Public Operator
Static Member
LessThanOrEqual

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.


Public Operator
Static Member
Multiply(Single, Vector3f)

Multiplies a vector by a number, having the effect of scaling it.


Public Operator
Static Member
Multiply(Vector3f, Vector3f)

Multiplies two Vector3f together, returning the dot (internal) product of the two. This is not the cross product.


Public Operator
Static Member
Multiply(Vector3f, Single)

Multiplies a vector by a number, having the effect of scaling it.


Public Operator
Static Member
Subtraction

Subtracts the second vector from the first one.


Public Operator
Static Member
UnaryNegation

Computes the opposite vector.