bookExamples.ch26Graphics.draw2d
Class Vec2d

java.lang.Object
  extended by bookExamples.ch26Graphics.draw2d.Vec2d

public class Vec2d
extends java.lang.Object


Field Summary
 double[] v
           
 
Constructor Summary
Vec2d(double x, double y)
           
Vec2d(java.awt.Point p)
           
Vec2d(Vec2d u)
           
 
Method Summary
 void add(Vec2d B)
           
 double dot(double Bx, double By)
           
 double dot(Vec2d B)
           
static double dot(Vec2d A, Vec2d B)
           
 double getX()
           
 double getY()
           
 double length()
           
 Vec2d linearComb(double a, Vec2d B)
           
 void mult(double factor)
           
 void normalize()
           
 void setLocation(int x, int y)
           
 void sub(Vec2d B)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

v

public double[] v
Constructor Detail

Vec2d

public Vec2d(double x,
             double y)

Vec2d

public Vec2d(Vec2d u)

Vec2d

public Vec2d(java.awt.Point p)
Method Detail

dot

public final double dot(Vec2d B)

dot

public final double dot(double Bx,
                        double By)

dot

public static double dot(Vec2d A,
                         Vec2d B)

linearComb

public Vec2d linearComb(double a,
                        Vec2d B)

length

public final double length()

normalize

public final void normalize()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

mult

public void mult(double factor)

add

public void add(Vec2d B)

sub

public void sub(Vec2d B)

setLocation

public void setLocation(int x,
                        int y)

getX

public double getX()

getY

public double getY()