Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.video.opengl

Class EM_3D_VECT


Direct ancestors

DOUBLE_MATH

Features

Invariants

indexing

description

This class represents a 3d vector.

date

$Date$

revision

$Revision$

expanded class

EM_3D_VECT

feature -- Commands

inc_x (an_double: DOUBLE)

-- Increment x with an_double

ensure
x_incremented: x = old (x) + an_double
inc_y (an_double: DOUBLE)

-- Increment y with an_double

ensure
y_incremented: y = old (y) + an_double
inc_z (an_double: DOUBLE)

-- Increment z with an_double

ensure
z_incremented: z = old (z) + an_double
infix "*" (other: DOUBLE): like Current

-- Multiply with a scalar

ensure
x_mult: Result.x = x * other
y_mult: Result.y = y * other
z_mult: Result.z = z * other
infix "+" (other: like Current): like Current

-- Add another vector

ensure
x_added: Result.x = x + other.x
y_added: Result.y = y + other.y
z_added: Result.z = z + other.z
commutative: Result = other + Current
infix "-" (other: like Current): like Current

-- Substract another vector

ensure
x_substracted: Result.x = x - other.x
y_substracted: Result.y = y - other.y
z_substracted: Result.z = z - other.z
length: DOUBLE

-- Return the length

ensure
result_positive: Result >= 0
set (a_x: DOUBLE; a_y: DOUBLE; a_z: DOUBLE)

-- Set the values

ensure
x_set: x = a_x
y_set: y = a_y
z_set: z = a_z

feature -- Status

x: DOUBLE

-- vector in x direction

y: DOUBLE

-- vector in y direction

z: DOUBLE

-- vector in z direction

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end