vray.Vector

class vray.Vector

Bases: object

A mathematical vector in 3D space. Supports the usual mathematical operations including dot and cross products (* and ^). The three components can be indexed like a list. This object is immutable.

  • Vector() -> new Vector with value (0, 0, 0)

  • Vector(x,y,z) -> new Vector initialized to (x,y,z)

Attributes

x

Vector X axis value

y

Vector Y axis value

z

Vector Z axis value

Methods

__init__()

length

Returns the length of this vector.

lengthSqr

Returns the length of this vector squared.

mixed

Returns the mixed product of the three vectors ((a ^ b) * c)

mul

Mutiplies the components of the given vectors.

normalize

Returns the normalized copy of the given vector.

rotate

Get a rotated vector along the given axis.

length()

Returns the length of this vector.

lengthSqr()

Returns the length of this vector squared.

static mixed()

Returns the mixed product of the three vectors ((a ^ b) * c)

static mul()

Mutiplies the components of the given vectors. Note that this is different from operator*, which does dot product.

normalize()

Returns the normalized copy of the given vector.

rotate()

Get a rotated vector along the given axis.

  • axis - An axis vector to rotate around. The length of the axis is the tangent of the angle of rotation.

Returns rotated vector

x

Vector X axis value

y

Vector Y axis value

z

Vector Z axis value