The Agent Tool  1.01
An Agent Based Graphic Sound Synthesis Environment
Public Member Functions
Vec2 Class Reference

A Vec2 represents a pair of numbers that can be represent a either a two dimensional point or a vector. More...

#include <Vec2.hpp>

List of all members.

Public Member Functions

Vec2 new ()
 A default constructor will provide you Vec2 with pair 0 0.
Vec2 operator+ (Vec2 r)
 Allows the addition of two Vec2's.
Vec2 operator+ (float r)
 Allows the scalar addition of a Vec2 affecting both components.
Vec2 operator+ (int r)
 Allows the scalar addition of a Vec2 affecting both components.
Vec2 operator- (Vec2 r)
 Allows the subtraction of one Vec2 from another.
Vec2 operator- (float r)
 Allows the subtraction of a scalar value from a Vec2 affecting both components.
Vec2 operator- (int r)
 Allows the subtraction of a scalar value from a Vec2 affecting both components.
Vec2 operator* (float r)
 Allows the scalar multiplication of a Vec2.
Vec2 operator* (int r)
 Allows the scalar multiplication of a Vec2.
Vec2 operator/ (float r)
 Allows the division of a Vec2.
float mag ()
Vec2 norm ()
Vec2 perp ()
float dot (const Vec2 &v) const
bool operator== (const Vec2 &r) const

Detailed Description

A Vec2 represents a pair of numbers that can be represent a either a two dimensional point or a vector.

To create a Vec2 in Lua you must call Vec2.new() to create an instance of this object. To execute on of the classes functions you must utilize a colon followed by the name ot the function. For example point:x() You can consequently set the x and y components via this mechanism. point:x() = 10


Member Function Documentation

float Vec2::dot ( const Vec2 v) const [inline]
Returns:
The dot product of the Vec2 (x*x + y*y)
float Vec2::mag ( )
Returns:
The magnitude of the Vec2 sqrt(x*x + y*y)
Vec2 Vec2::new ( ) [inline]

A default constructor will provide you Vec2 with pair 0 0.

Allows the construction of with a pair of floating point numbers.

Returns:
The y value of the pair.
Vec2 Vec2::norm ( )
Returns:
A normalized version of the Vec2
Vec2 Vec2::operator* ( float  r)

Allows the scalar multiplication of a Vec2.

Returns:
A new Vec2 reflecting the scalar multiplication of the Vec2
Vec2 Vec2::operator* ( int  r)

Allows the scalar multiplication of a Vec2.

Returns:
A new Vec2 reflecting the scalar multiplication of the Vec2
Vec2 Vec2::operator+ ( Vec2  r)

Allows the addition of two Vec2's.

Returns:
A new Vec2 reflecting the sum of two Vec2's
Vec2 Vec2::operator+ ( float  r)

Allows the scalar addition of a Vec2 affecting both components.

Returns:
A new Vec2 reflecting the scalar summation
Vec2 Vec2::operator+ ( int  r)

Allows the scalar addition of a Vec2 affecting both components.

Returns:
A new Vec2 reflecting the scalar summation
Vec2 Vec2::operator- ( Vec2  r)

Allows the subtraction of one Vec2 from another.

Returns:
A new Vec2 reflecting the subtraction of one Vec2 from another
Vec2 Vec2::operator- ( float  r)

Allows the subtraction of a scalar value from a Vec2 affecting both components.

Returns:
A new Vec2 reflecting the scalar subtraction from the Vec2
Vec2 Vec2::operator- ( int  r)

Allows the subtraction of a scalar value from a Vec2 affecting both components.

Returns:
A new Vec2 reflecting the scalar subtraction from the Vec2
Vec2 Vec2::operator/ ( float  r)

Allows the division of a Vec2.

Returns:
A new Vec2 reflecting the scalar division of the Vec2
Vec2 Vec2::perp ( )
Returns:
The perpendicual of the Vec2

The documentation for this class was generated from the following file:
 All Classes Files Functions