class Vector2D

This class is designed to handle a vector in 2D

Inheritance:


Public Methods

[more] constructors (same as Point2D)
[more]virtual ~Vector2D()
destructor
[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_, int line_width_ = 1, int line_style_ = LineSolid, bool fill_ = false, int fill_style_ = FillSolid)


Documentation

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()
destructor

o Vector2D Unary Operations

oVector2D operator-()
Unary minus

oVector2D operator~()
Unary 2D perp operator

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 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.
Author:
Sebastien Marcel (marcel@idiap.ch) Dan Sunday (http://www.softsurfer.com/)
Version:
2.1 Wed 28 Jun 2006 05:19:33 PM CEST
Since:
1.0

Alphabetic index HTML hierarchy of classes or Java



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