Module gengeo :: Class Vector3

[hide private]
[frames] | no frames]

# Class Vector3

     object --+
              |
    ??.instance --+
                  |
                 Vector3

A class defining a location or vector in 3D space

Instance Methods | [hide private]

double

X(...) Returns the x-coordinate of the vector. |

double

Y(...) Returns the y-coordinate of the vector. |

double

Z(...) Returns the z-coordinate of the vector. |

__add__(...) |

__eq__(...) |

__init__(...) Constructs a vector with specifed component values. |

__mul__(...) |

__reduce__(...) helper for pickle |

__str__(...) str(x) |

__sub__(...) |

Vector3

cross(...) Returns the cross product of this 3-element vector with the specified Vector3. |

float

dot(...) Returns the dot product of this 3-element vector with the specified Vector3. |

float

norm(...) Returns the magnitude of this 3-element vector. |

Vector3

unit(...) Returns the unit vector in the direction of this 3-element vector. |

Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| __instance_size__ = `32`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(...)
(Constructor)

Constructs a vector 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 Vector3.

Parameters:
  - `v` (Vector3) - cross product with this
Returns: Vector3

### dot(...)

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

Parameters:
  - `v` (Vector3) - dot product with this
Returns: float

### norm(...)

Returns the magnitude of this 3-element vector.

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

### unit(...)

Returns the unit vector in the direction of this 3-element vector.

Returns: Vector3
  self/self.norm(self).