Package esys :: Package lsm :: Package util :: Module FoundationPy :: Class Vec3
[hide private]
[frames] | no frames]

Class Vec3

 object --+    
          |    
??.instance --+
              |
             Vec3

A 3D coordinate.

Instance Methods [hide private]
 
__add__(...)
 
__div__(...)
 
__eq__(...)
 
__getinitargs__(...)
 
__getitem__(...)
 
__init__(...)
Constructs coordinate with specifed component values.
 
__len__(...)
 
__mul__(...)
 
__reduce__(...)
helper for pickle
 
__setitem__(...)
 
__str__(...)
str(x)
 
__sub__(...)
Vec3
cross(...)
Returns the cross product of this 3 element vector with the specified Vec3.
float
dot(...)
Returns the dot product of this 3 element vector with the specified Vec3.
float
norm(...)
Returns the magnitude of this 3 element vector.
Vec3
rotate(...)
Returns a point which is this point rotated about a specified axis.
list of three floats
toList(...)
Returns a python list of 3 elements.
tuple of three floats
toTuple(...)
Returns a python tuple of 3 elements.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  __instance_size__ = 40
  __safe_for_unpickling__ = True
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

Constructs coordinate with specifed component values.

Parameters:
  • x (float) - index 0
  • y (float) - index 1
  • z (float) - index 2
Overrides: object.__init__

__reduce__(...)

 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

__str__(...)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

cross(...)

 

Returns the cross product of this 3 element vector with the specified Vec3.

Parameters:
  • v (Vec3) - cross product with this
Returns: Vec3

dot(...)

 

Returns the dot product of this 3 element vector with the specified Vec3.

Parameters:
  • v (Vec3) - dot product with this
Returns: float

norm(...)

 

Returns the magnitude of this 3 element vector.

Returns: float
math.sqrt(self.dot(self)).

rotate(...)

 

Returns a point which is this point rotated about a specified axis.

Parameters:
  • axis (Vec3) - axis of rotation and counter-clockwise angle of rotation = axis.norm() radians.
  • axisPt (Vec3) - The axis of rotation is assumed to pass through this point.
Returns: Vec3
The point which is the rotation of this (self) coordinate about the specified axis.

toList(...)

 

Returns a python list of 3 elements.

Returns: list of three floats
[self[0],self[1],self[2]]

toTuple(...)

 

Returns a python tuple of 3 elements.

Returns: tuple of three floats
(self[0],self[1],self[2])