cocos.euclid module

euclid graphics maths module

Documentation and tests are included in the file “euclid.txt”, or online at http://code.google.com/p/pyeuclid

class Circle(center, radius)

Bases: cocos.euclid.Geometry, cocos.euclid.Slotted

connect(other)
copy()
intersect(other)
c
r
class Geometry

Bases: object

connect(other)
distance(other)
intersect(other)
class Line2(*args)

Bases: cocos.euclid.Geometry, cocos.euclid.Slotted

connect(other)
copy()
intersect(other)
p
p1
p2
v
class Line3(*args)

Bases: cocos.euclid.Slotted

connect(other)
copy()
intersect(other)
p
p1
p2
v
class LineSegment2(*args)

Bases: cocos.euclid.Line2

magnitude_squared()
length
class LineSegment3(*args)

Bases: cocos.euclid.Line3

magnitude_squared()
length
class Matrix3

Bases: cocos.euclid.Slotted

copy()
determinant()
identity()
inverse()
classmethod new_identity()
classmethod new_rotate(angle)
classmethod new_scale(x, y)
classmethod new_translate(x, y)
rotate(angle)
scale(x, y)
translate(x, y)
a
b
c
e
f
g
i
j
k
class Matrix4

Bases: cocos.euclid.Slotted

copy()
determinant()
identity()
inverse()
classmethod new(*values)
classmethod new_identity()
classmethod new_look_at(eye, at, up)
classmethod new_perspective(fov_y, aspect, near, far)
classmethod new_rotate_axis(angle, axis)
classmethod new_rotate_euler(heading, attitude, bank)
classmethod new_rotate_triple_axis(x, y, z)
classmethod new_rotatex(angle)
classmethod new_rotatey(angle)
classmethod new_rotatez(angle)
classmethod new_scale(x, y, z)
classmethod new_translate(x, y, z)
rotate_axis(angle, axis)
rotate_euler(heading, attitude, bank)
rotate_triple_axis(x, y, z)
rotatex(angle)
rotatey(angle)
rotatez(angle)
scale(x, y, z)
transform(other)
translate(x, y, z)
transpose()
transposed()
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
class Plane(*args)

Bases: cocos.euclid.Slotted

connect(other)
copy()
intersect(other)
k
n
class Point2(x=0, y=0)

Bases: cocos.euclid.Vector2, cocos.euclid.Geometry

connect(other)
intersect(other)
class Point3(x=0, y=0, z=0)

Bases: cocos.euclid.Vector3, cocos.euclid.Geometry

connect(other)
intersect(other)
class Quaternion(w=1, x=0, y=0, z=0)

Bases: cocos.euclid.Slotted

conjugated()
copy()
get_angle_axis()
get_euler()
get_matrix()
identity()
magnitude()
magnitude_squared()
classmethod new_identity()
classmethod new_interpolate(q1, q2, t)
classmethod new_rotate_axis(angle, axis)
classmethod new_rotate_euler(heading, attitude, bank)
classmethod new_rotate_matrix(m)
normalize()
normalized()
rotate_axis(angle, axis)
rotate_euler(heading, attitude, bank)
rotate_matrix(m)
w
x
y
z
class Ray2(*args)

Bases: cocos.euclid.Line2

class Ray3(*args)

Bases: cocos.euclid.Line3

class Slotted

Bases: object

class Sphere(center, radius)

Bases: cocos.euclid.Slotted

connect(other)
copy()
intersect(other)
c
r
class Vector2(x=0, y=0)

Bases: cocos.euclid.Slotted

angle(other)

Return the angle to the vector other

copy()
cross()
dot(other)
magnitude()
magnitude_squared()
normalize()
normalized()
project(other)

Return one vector projected on the vector other

reflect(normal)
x
xy

(x, y)

y
yx

(y, x)

class Vector3(x=0, y=0, z=0)

Bases: cocos.euclid.Slotted

angle(other)

Return the angle to the vector other

copy()
cross(other)
dot(other)
magnitude()
magnitude_squared()
normalize()
normalized()
project(other)

Return one vector projected on the vector other

reflect(normal)
rotate_around(axis, theta)

Return the vector rotated around axis through angle theta. Right hand rule applies

x
xy

(x, y)

xyz

(x, y, z)

xz

(x, z)

xzy

(x, z, y)

y
yx

(y, x)

yxz

(y, x, z)

yz

(y, z)

yzx

(y, z, x)

z
zx

(z, x)

zxy

(z, x, y)

zy

(z, y)

zyx

(z, y, x)