class Vector2D

This class is designed to handle a vector in 2D


Public Methods

[more] constructors (same as Point2D)
[more]virtual ~Vector2D()
[more] Vector2D Unary Operations
[more] Vector2D Arithmetic Operations
[more] Vector Properties
[more]void normalize()
convert vector to unit length
[more]double angle()
compute the angle (in radian) with the horizontal

Inherited from Point2D:

Public Fields

odouble x
odouble y

Public Methods

Lots of Constructors

reset functions

ovirtual void saveXFile(XFile* file)
ovirtual void loadXFile(XFile* file)
ovirtual const char* sprint()
ovirtual void draw(Image* image, Color color)
oint operator==(Point2D)
oint operator!=(Point2D)

Point2D and Vector2D operations

collinearity conditions

odouble isLeft(Point2D, Point2D)
odouble Area(Point2D, Point2D)
osPoint2D get()
ovoid fixI()

Inherited from geomObject:

Public Fields

obool verbose

Public Methods

ovirtual void xdraw(Display* pDisplay_, Pixmap pixmap_, GC gc_, unsigned long color_)


This class is designed to handle a vector in 2D

o constructors (same as Point2D)

o Vector2D()

o Vector2D(int a)

o Vector2D(double a)

o Vector2D(int a, int b)

o Vector2D(double a, double b)

ovirtual ~Vector2D()

o Vector2D Unary Operations

oVector2D operator-()
Unary minus

oVector2D operator~()
Unary 2D perp operator

o Point2D scalar multiplication and divisions
Vector2D operator*(int, Vector2D)
Vector2D operator*(double, Vector2D)
Vector2D operator*(Vector2D, int)
Vector2D operator*(Vector2D, double)
Vector2D operator/(Vector2D, int)
Vector2D operator/(Vector2D, double)

o Vector2D Arithmetic Operations

oVector2D operator+(Vector2D)
vector add

oVector2D operator-(Vector2D)
vector subtract

odouble operator*(Vector2D)
inner dot product

odouble operator|(Vector2D)
2D exterior perp product

oVector2D& operator*=(double)
vector scalar mult

oVector2D& operator/=(double)
vector scalar div

oVector2D& operator+=(Vector2D)
vector increment

oVector2D& operator-=(Vector2D)
vector decrement

o Vector2D rotation/scale
Vector2D operator*(Vector2D, Matrix2D)

o Vector Properties

odouble len()
vector length

odouble len2()
vector length squared (faster)

ovoid normalize()
convert vector to unit length

odouble angle()
compute the angle (in radian) with the horizontal

This class has no child classes.
class Matrix2D
Sebastien Marcel ( Dan Sunday (
2.0 Fri 15 Jul 2005 11:35:20 AM CEST

Alphabetic index HTML hierarchy of classes or Java

This page was generated with the help of DOC++.