Skip to content

T_Rhino_Geometry_Vector2d

Will Pearson edited this page Aug 12, 2016 · 2 revisions

Vector2d Structure

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

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: Rhino 6.0

Syntax

C#

[SerializableAttribute]
public struct Vector2d : ISerializable, IEquatable<Vector2d>, 
	IComparable<Vector2d>, IComparable

VB

<SerializableAttribute>
Public Structure Vector2d
	Implements ISerializable, IEquatable(Of Vector2d), 
	IComparable(Of Vector2d), IComparable

The Vector2d type exposes the following members.

Constructors

 

Name Description
Public method Vector2d Initializes a new instance of the vector based on two, X and Y, components.
  Back to Top

Properties

 

Name Description
Public property IsValid Gets a value indicating whether this vector is valid. A valid vector must be formed of valid component values for x, y and z.
Public property Length Computes the length (or magnitude, or size) of this vector. This is an application of Pythagoras' theorem.
Public propertyStatic member Unset Gets the value of the vector with components set as RhinoMath.UnsetValue,RhinoMath.UnsetValue.
Public property X Gets or sets the X (first) component of this vector.
Public property Y Gets or sets the Y (second) component of this vector.
Public propertyStatic member Zero Gets the value of the vector with components 0,0.
  Back to Top

Methods

 

Name Description
Public methodStatic member Add Sums up two vectors. (Provided for languages that do not support operator overloading. You can use the + operator otherwise)
Public method CompareTo Compares this Vector2d with another Vector2d. Components evaluation priority is first X, then Y.
Public methodStatic member Divide Divides a Vector2d by a number, having the effect of shrinking it. (Provided for languages that do not support operator overloading. You can use the / operator otherwise)
Public method EpsilonEquals Check that all values in other are within epsilon of the values in this
Public method Equals(Object) Determines whether the specified System.Object is a Vector2d and has the same value as the present vector. (Overrides ValueType.Equals(Object).)
Public method Equals(Vector2d) Determines whether the specified vector has the same value as the present vector.
Public method GetHashCode Provides a hashing value for the present vector. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsTiny() Uses RhinoMath.ZeroTolerance for IsTiny calculation.
Public methodCode example IsTiny(Double) Determines whether a vector is very short.
Public methodStatic member Multiply(Double, Vector2d) 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 methodStatic member Multiply(Vector2d, Vector2d) Multiplies two vectors together, returning the dot product (or inner product). (Provided for languages that do not support operator overloading. You can use the * operator otherwise)
Public methodStatic member Multiply(Vector2d, Double) 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 methodStatic member Negate Computes the reversed vector. (Provided for languages that do not support operator overloading. You can use the - unary operator otherwise)
Public methodStatic member Subtract 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 ToString Constructs a string representation of the current vector. (Overrides ValueType.ToString().)
Public method Unitize Unitizes the vector in place. A unit vector has length 1 unit. An invalid or zero length vector cannot be unitized.
  Back to Top

Operators

 

Name Description
Public operatorStatic member Addition Sums up two vectors.
Public operatorStatic member Division Divides a Vector2d by a number, having the effect of shrinking it.
Public operatorStatic member Equality Determines whether two vectors have equal values.
Public operatorStatic member GreaterThan Determines whether the first specified vector comes after (has superior sorting value than) the second vector. Components have decreasing evaluation priority: first X, then Y.
Public operatorStatic 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 have decreasing evaluation priority: first X, then Y.
Public operatorStatic member Inequality Determines whether two vectors have different values.
Public operatorStatic member LessThan Determines whether the first specified vector comes before (has inferior sorting value than) the second vector. Components have decreasing evaluation priority: first X, then Y.
Public operatorStatic 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 have decreasing evaluation priority: first X, then Y.
Public operatorStatic member Multiply(Double, Vector2d) Multiplies a vector by a number, having the effect of scaling it.
Public operatorStatic member Multiply(Vector2d, Vector2d) Multiplies two vectors together, returning the dot product (or inner product).
Public operatorStatic member Multiply(Vector2d, Double) Multiplies a vector by a number, having the effect of scaling it.
Public operatorStatic member Subtraction Subtracts the second vector from the first one.
Public operatorStatic member UnaryNegation Computes the opposite vector.
  Back to Top

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

Rhino.Geometry Namespace

Clone this wiki locally