igeo
Class IVec2

java.lang.Object
  extended by igeo.IParameterObject
      extended by igeo.IVec2
All Implemented Interfaces:
IEntityParameter, IParameter, ISubobject, IVec2I, IVec2Op
Direct Known Subclasses:
IPolyline2D.Intersection

public class IVec2
extends IParameterObject
implements IVec2I, IEntityParameter

Class of 2 dimensional vector.


Field Summary
 double x
           
 double y
           
 
Fields inherited from class igeo.IParameterObject
parent
 
Constructor Summary
IVec2()
           
IVec2(double x, double y)
           
IVec2(IDoubleI x, IDoubleI y)
           
IVec2(IServerI s)
           
IVec2(IServerI s, double x, double y)
           
IVec2(IServerI s, IDoubleI x, IDoubleI y)
           
IVec2(IServerI s, IVec2 v)
           
IVec2(IServerI s, IVec2I v)
           
IVec2(IServerI s, IVecI v)
           
IVec2(IVec2 v)
           
IVec2(IVec2I v)
           
IVec2(IVecI v)
           
 
Method Summary
 IVec2 add(double x, double y)
           
 IVec2 add(IDoubleI x, IDoubleI y)
           
 IVec2 add(IVec2 v)
           
 IVec2 add(IVec2 v, double f)
          scale add
 IVec2 add(IVec2I v)
           
 IVec2 add(IVec2I v, double f)
           
 IVec2 add(IVec2I v, IDoubleI f)
           
 double angle(ISwitchE e, IVec2I v)
           
 IDouble angle(ISwitchR r, IVec2I v)
           
 double angle(IVec2 v)
           
 double angle(IVec2I v)
           
 IVec2 bisect(IVec2 v)
           
 IVec2 bisect(IVec2I v)
           
 IVec cross(IVec2 v)
           
 IVec cross(IVec2I v)
           
 IVec2 diff(IVec2I v)
           
 double dist(ISwitchE e, IVec2I v)
           
 IDouble dist(ISwitchR r, IVec2I v)
           
 double dist(IVec2 v)
           
 double dist(IVec2I v)
          distance
 double dist2(ISwitchE e, IVec2I v)
           
 IDouble dist2(ISwitchR r, IVec2I v)
           
 double dist2(IVec2 v)
           
 double dist2(IVec2I v)
          squared distance
 double distToLine(IVec2 pt1, IVec2 pt2)
           
 IVec2 div(double x)
           
 IVec2 div(IDouble v)
           
 IVec2 div(IDoubleI v)
           
 double dot(ISwitchE e, IVec2I v)
           
 IDouble dot(ISwitchR r, IVec2I v)
           
 double dot(IVec2 v)
           
 double dot(IVec2I v)
           
 IVec2 dup()
           
 boolean eq(ISwitchE e, IVec2I v)
           
 boolean eq(ISwitchE e, IVec2I v, double resolution)
           
 IBool eq(ISwitchR r, IVec2I v)
           
 IBool eq(ISwitchR r, IVec2I v, IDoubleI resolution)
           
 boolean eq(IVec2 v)
          whether location is same or not
 boolean eq(IVec2 v, double resolution)
           
 boolean eq(IVec2I v)
          whether location is same or not
 boolean eq(IVec2I v, double resolution)
           
 boolean eqX(ISwitchE e, IVec2I v)
           
 boolean eqX(ISwitchE e, IVec2I v, double resolution)
           
 IBool eqX(ISwitchR r, IVec2I v)
           
 IBool eqX(ISwitchR r, IVec2I v, IDoubleI resolution)
           
 boolean eqX(IVec2 v)
           
 boolean eqX(IVec2 v, double resolution)
           
 boolean eqX(IVec2I v)
           
 boolean eqX(IVec2I v, double resolution)
           
 boolean eqY(ISwitchE e, IVec2I v)
           
 boolean eqY(ISwitchE e, IVec2I v, double resolution)
           
 IBool eqY(ISwitchR r, IVec2I v)
           
 IBool eqY(ISwitchR r, IVec2I v, IDoubleI resolution)
           
 boolean eqY(IVec2 v)
           
 boolean eqY(IVec2 v, double resolution)
           
 boolean eqY(IVec2I v)
           
 boolean eqY(IVec2I v, double resolution)
           
 IVec2 get()
           
 IDouble getX()
           
 IDouble getY()
           
static IVec2 intersect(IVec2I pt1, IVec2I dir1, IVec2I pt2, IVec2I dir2)
           
static IVec2 intersectPolygon(IVec2I p1, IVec2I p2, IVec2I[] pts)
           
static IVec2 intersectPolyline(IVec2I p1, IVec2I p2, IVec2I[] pts)
           
static IVec2 intersectPolyline(IVec2I p1, IVec2I p2, IVec2I[] pts, boolean closed)
           
static IVec2 intersectSegment(IVec2I line1pt1, IVec2I line1pt2, IVec2I line2pt1, IVec2I line2pt2)
           
static IVec2 intersectSegmentAndXLine(IVec2I linePt1, IVec2I linePt2, double y)
           
static IVec2 intersectSegmentAndYLine(IVec2I linePt1, IVec2I linePt2, double x)
           
static IVec2 intersectXLine(IVec2 linePt, IVec2 lineDir, double yOfXLine)
           
static IVec2 intersectYLine(IVec2 linePt, IVec2 lineDir, double xOfYLine)
           
 boolean isBetween(IVec2I pt1, IVec2I pt2)
           
 boolean isInside(IVec2[] pts)
          determine if the point is insde the polygon defined by the argument true if the point is on the edge of polygon
 boolean isInside(IVec2I[] pts)
          determine if the point is insde the polygon defined by the argument
 boolean isOnLine(IVec2 pt1, IVec2 pt2)
           
 boolean isParallel(IVec2I v)
           
 boolean isParallel(IVec2I v, double angleReso)
           
 boolean isStraight(IVec2I v1, IVec2I v2)
           
 boolean isStraight(IVec2I v1, IVec2I v2, double angleReso)
           
 double len()
           
 IVec2 len(double l)
           
 IVec2 len(IDoubleI l)
           
 double len(ISwitchE e)
           
 IDouble len(ISwitchR r)
           
 double len2()
           
 double len2(ISwitchE e)
           
 IDouble len2(ISwitchR r)
           
 IVec2 mid(IVec2I v)
           
 IVec2 mirror(IVec2 lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 mirror(IVec2I lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 mirror(IVec2I linePt, IVec2I lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 mirror(IVec2 linePt, IVec2 lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 mul(double x)
           
 IVec2 mul(IDouble v)
           
 IVec2 mul(IDoubleI v)
           
 IVec2 neg()
           
 IVec2 ortho()
          rotate vector in Pi/2
 IVec2 ref(IVec2 lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 ref(IVec2I lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 ref(IVec2I linePt, IVec2I lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
 IVec2 ref(IVec2 linePt, IVec2 lineDir)
          reflect (mirror) 2 dimensionally to the other side of the line
static IVec2I[] removeDuplicatedPoints(IVec2I[] pts, boolean closed)
           
static IVec2I[] removeStraightPoints(IVec2I[] pts, boolean closed)
          remove points which are on straight line of adjacents
 IVec2 rev()
           
 IVec2 rot(double angle)
           
 IVec2 rot(IDoubleI angle)
           
 IVec2 rot(IVec2 destDir)
           
 IVec2 rot(IVec2 center, double angle)
           
 IVec2 rot(IVec2I destDir)
           
 IVec2 rot(IVec2I center, double angle)
           
 IVec2 rot(IVec2I center, IDoubleI angle)
           
 IVec2 rot(IVec2I center, IVec2I destPt)
           
 IVec2 rot(IVec2 center, IVec2 destPt)
           
 IVec2 scale(double f)
           
 IVec2 scale(IDoubleI f)
           
 IVec2 scale(IVec2 center, double f)
           
 IVec2 scale(IVec2I center, double f)
           
 IVec2 scale(IVec2I center, IDoubleI f)
           
 IVec2 set(double x, double y)
           
 IVec2 set(IDoubleI x, IDoubleI y)
           
 IVec2 set(IVec2 v)
           
 IVec2 set(IVec2I v)
           
 IVec2 sub(double x, double y)
           
 IVec2 sub(IDoubleI x, IDoubleI y)
           
 IVec2 sub(IVec2 v)
           
 IVec2 sub(IVec2I v)
           
 IVec2 sum(IVec2 v2, double w2)
           
 IVec2 sum(IVec2 v2, double w1, double w2)
          weighted sum
 IVec2 sum(IVec2I... v)
           
 IVec2 sum(IVec2I v)
           
 IVec2 sum(IVec2I v2, double w2)
           
 IVec2 sum(IVec2I v2, double w1, double w2)
          weighted sum
 IVec2 sum(IVec2I v2, IDoubleI w2)
           
 IVec2 sum(IVec2I v2, IDoubleI w1, IDoubleI w2)
           
 IVec to3d()
           
 IVec to3d(double z)
           
 IVec to3d(IDoubleI z)
           
 IVec4 to4d()
           
 IVec4 to4d(double z, double w)
           
 IVec4 to4d(IDoubleI z, IDoubleI w)
           
 java.lang.String toString()
           
 IVec2 transform(IVec2I xvec, IVec2I yvec)
           
 IVec2 transform(IVec2I xvec, IVec2I yvec, IVec2I translate)
           
 IVec2 transform(IVec2 xvec, IVec2 yvec)
           
 IVec2 transform(IVec2 xvec, IVec2 yvec, IVec2 translate)
           
 IVec2 unit()
          normalize (unitize) vector
 double x()
           
 double y()
           
 
Methods inherited from class igeo.IParameterObject
createObject, parent, parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

IVec2

public IVec2()

IVec2

public IVec2(double x,
             double y)

IVec2

public IVec2(IVec2 v)

IVec2

public IVec2(IVec2I v)

IVec2

public IVec2(IDoubleI x,
             IDoubleI y)

IVec2

public IVec2(IVecI v)

IVec2

public IVec2(IServerI s)

IVec2

public IVec2(IServerI s,
             double x,
             double y)

IVec2

public IVec2(IServerI s,
             IVec2 v)

IVec2

public IVec2(IServerI s,
             IVec2I v)

IVec2

public IVec2(IServerI s,
             IDoubleI x,
             IDoubleI y)

IVec2

public IVec2(IServerI s,
             IVecI v)
Method Detail

x

public double x()
Specified by:
x in interface IVec2I

y

public double y()
Specified by:
y in interface IVec2I

get

public IVec2 get()
Specified by:
get in interface IParameter
Specified by:
get in interface IVec2I
Specified by:
get in interface IVec2Op

dup

public IVec2 dup()
Specified by:
dup in interface IVec2I

to3d

public IVec to3d()
Specified by:
to3d in interface IVec2I

to3d

public IVec to3d(double z)
Specified by:
to3d in interface IVec2I

to3d

public IVec to3d(IDoubleI z)
Specified by:
to3d in interface IVec2I

to4d

public IVec4 to4d()
Specified by:
to4d in interface IVec2I

to4d

public IVec4 to4d(double z,
                  double w)
Specified by:
to4d in interface IVec2I

to4d

public IVec4 to4d(IDoubleI z,
                  IDoubleI w)
Specified by:
to4d in interface IVec2I

getX

public IDouble getX()
Specified by:
getX in interface IVec2I

getY

public IDouble getY()
Specified by:
getY in interface IVec2I

set

public IVec2 set(double x,
                 double y)
Specified by:
set in interface IVec2I

set

public IVec2 set(IVec2 v)

set

public IVec2 set(IVec2I v)
Specified by:
set in interface IVec2I

set

public IVec2 set(IDoubleI x,
                 IDoubleI y)
Specified by:
set in interface IVec2I

add

public IVec2 add(double x,
                 double y)
Specified by:
add in interface IVec2I

add

public IVec2 add(IDoubleI x,
                 IDoubleI y)
Specified by:
add in interface IVec2I

add

public IVec2 add(IVec2 v)

add

public IVec2 add(IVec2I v)
Specified by:
add in interface IVec2I

sub

public IVec2 sub(double x,
                 double y)
Specified by:
sub in interface IVec2I

sub

public IVec2 sub(IDoubleI x,
                 IDoubleI y)
Specified by:
sub in interface IVec2I

sub

public IVec2 sub(IVec2 v)

sub

public IVec2 sub(IVec2I v)
Specified by:
sub in interface IVec2I

mul

public IVec2 mul(double x)
Specified by:
mul in interface IVec2I

mul

public IVec2 mul(IDouble v)

mul

public IVec2 mul(IDoubleI v)
Specified by:
mul in interface IVec2I

div

public IVec2 div(double x)
Specified by:
div in interface IVec2I

div

public IVec2 div(IDouble v)

div

public IVec2 div(IDoubleI v)
Specified by:
div in interface IVec2I

neg

public IVec2 neg()
Specified by:
neg in interface IVec2I

rev

public IVec2 rev()
Specified by:
rev in interface IVec2I

add

public IVec2 add(IVec2 v,
                 double f)
scale add


add

public IVec2 add(IVec2I v,
                 double f)
Specified by:
add in interface IVec2I

add

public IVec2 add(IVec2I v,
                 IDoubleI f)
Specified by:
add in interface IVec2I

dot

public double dot(IVec2 v)
Returns:
dot product in double (P for Primitive)

dot

public double dot(IVec2I v)
Specified by:
dot in interface IVec2I

dot

public double dot(ISwitchE e,
                  IVec2I v)
Specified by:
dot in interface IVec2I

dot

public IDouble dot(ISwitchR r,
                   IVec2I v)
Specified by:
dot in interface IVec2I

cross

public IVec cross(IVec2 v)
Returns:
cross product in z direction

cross

public IVec cross(IVec2I v)
Specified by:
cross in interface IVec2I

len

public double len()
Specified by:
len in interface IVec2I
Returns:
length (norm) of the vector in double (P for Primitive)

len

public double len(ISwitchE e)
Specified by:
len in interface IVec2I

len

public IDouble len(ISwitchR r)
Specified by:
len in interface IVec2I

len2

public double len2()
Specified by:
len2 in interface IVec2I
Returns:
squared length of the vector in double (P for Primitive)

len2

public double len2(ISwitchE e)
Specified by:
len2 in interface IVec2I

len2

public IDouble len2(ISwitchR r)
Specified by:
len2 in interface IVec2I

len

public IVec2 len(IDoubleI l)
Specified by:
len in interface IVec2I

len

public IVec2 len(double l)
Specified by:
len in interface IVec2I

unit

public IVec2 unit()
normalize (unitize) vector

Specified by:
unit in interface IVec2I

ortho

public IVec2 ortho()
rotate vector in Pi/2

Specified by:
ortho in interface IVec2I

dist

public double dist(IVec2 v)

dist

public double dist(IVec2I v)
Description copied from interface: IVec2I
distance

Specified by:
dist in interface IVec2I

dist

public double dist(ISwitchE e,
                   IVec2I v)
Specified by:
dist in interface IVec2I

dist

public IDouble dist(ISwitchR r,
                    IVec2I v)
Specified by:
dist in interface IVec2I

dist2

public double dist2(IVec2 v)

dist2

public double dist2(IVec2I v)
Description copied from interface: IVec2I
squared distance

Specified by:
dist2 in interface IVec2I

dist2

public double dist2(ISwitchE e,
                    IVec2I v)
Specified by:
dist2 in interface IVec2I

dist2

public IDouble dist2(ISwitchR r,
                     IVec2I v)
Specified by:
dist2 in interface IVec2I

eq

public boolean eq(IVec2 v)
whether location is same or not


eq

public boolean eq(IVec2I v)
Description copied from interface: IVec2I
whether location is same or not

Specified by:
eq in interface IVec2I

eq

public boolean eq(ISwitchE e,
                  IVec2I v)
Specified by:
eq in interface IVec2I

eq

public IBool eq(ISwitchR r,
                IVec2I v)
Specified by:
eq in interface IVec2I

eq

public boolean eq(IVec2 v,
                  double resolution)

eq

public boolean eq(IVec2I v,
                  double resolution)
Specified by:
eq in interface IVec2I

eq

public boolean eq(ISwitchE e,
                  IVec2I v,
                  double resolution)
Specified by:
eq in interface IVec2I

eq

public IBool eq(ISwitchR r,
                IVec2I v,
                IDoubleI resolution)
Specified by:
eq in interface IVec2I

eqX

public boolean eqX(IVec2 v)

eqY

public boolean eqY(IVec2 v)

eqX

public boolean eqX(IVec2I v)
Specified by:
eqX in interface IVec2I

eqY

public boolean eqY(IVec2I v)
Specified by:
eqY in interface IVec2I

eqX

public boolean eqX(ISwitchE e,
                   IVec2I v)
Specified by:
eqX in interface IVec2I

eqY

public boolean eqY(ISwitchE e,
                   IVec2I v)
Specified by:
eqY in interface IVec2I

eqX

public IBool eqX(ISwitchR r,
                 IVec2I v)
Specified by:
eqX in interface IVec2I

eqY

public IBool eqY(ISwitchR r,
                 IVec2I v)
Specified by:
eqY in interface IVec2I

eqX

public boolean eqX(IVec2 v,
                   double resolution)

eqY

public boolean eqY(IVec2 v,
                   double resolution)

eqX

public boolean eqX(IVec2I v,
                   double resolution)
Specified by:
eqX in interface IVec2I

eqY

public boolean eqY(IVec2I v,
                   double resolution)
Specified by:
eqY in interface IVec2I

eqX

public boolean eqX(ISwitchE e,
                   IVec2I v,
                   double resolution)
Specified by:
eqX in interface IVec2I

eqY

public boolean eqY(ISwitchE e,
                   IVec2I v,
                   double resolution)
Specified by:
eqY in interface IVec2I

eqX

public IBool eqX(ISwitchR r,
                 IVec2I v,
                 IDoubleI resolution)
Specified by:
eqX in interface IVec2I

eqY

public IBool eqY(ISwitchR r,
                 IVec2I v,
                 IDoubleI resolution)
Specified by:
eqY in interface IVec2I

angle

public double angle(IVec2 v)
Returns:
angle of two vector. From -Pi to Pi. Sign follows right-handed screw rule (P for Primitive)

angle

public double angle(IVec2I v)
Specified by:
angle in interface IVec2I

angle

public double angle(ISwitchE e,
                    IVec2I v)
Specified by:
angle in interface IVec2I

angle

public IDouble angle(ISwitchR r,
                     IVec2I v)
Specified by:
angle in interface IVec2I

rot

public IVec2 rot(double angle)
Specified by:
rot in interface IVec2I

rot

public IVec2 rot(IDoubleI angle)
Specified by:
rot in interface IVec2I

rot

public IVec2 rot(IVec2 center,
                 double angle)

rot

public IVec2 rot(IVec2I center,
                 double angle)
Specified by:
rot in interface IVec2I

rot

public IVec2 rot(IVec2I center,
                 IDoubleI angle)
Specified by:
rot in interface IVec2I

rot

public IVec2 rot(IVec2 destDir)

rot

public IVec2 rot(IVec2I destDir)
Specified by:
rot in interface IVec2I

rot

public IVec2 rot(IVec2 center,
                 IVec2 destPt)

rot

public IVec2 rot(IVec2I center,
                 IVec2I destPt)
Specified by:
rot in interface IVec2I

scale

public IVec2 scale(double f)
Specified by:
scale in interface IVec2I

scale

public IVec2 scale(IDoubleI f)
Specified by:
scale in interface IVec2I

scale

public IVec2 scale(IVec2 center,
                   double f)

scale

public IVec2 scale(IVec2I center,
                   double f)
Specified by:
scale in interface IVec2I

scale

public IVec2 scale(IVec2I center,
                   IDoubleI f)
Specified by:
scale in interface IVec2I

ref

public IVec2 ref(IVec2 lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Parameters:
lineDir - direction of reflection line

ref

public IVec2 ref(IVec2I lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Specified by:
ref in interface IVec2I
Parameters:
lineDir - direction of reflection line

ref

public IVec2 ref(IVec2 linePt,
                 IVec2 lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Parameters:
linePt - start point of reflection line
lineDir - direction of reflection line

ref

public IVec2 ref(IVec2I linePt,
                 IVec2I lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Specified by:
ref in interface IVec2I
Parameters:
linePt - start point of reflection line
lineDir - direction of reflection line

mirror

public IVec2 mirror(IVec2 lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Parameters:
lineDir - direction of reflection line

mirror

public IVec2 mirror(IVec2I lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Specified by:
mirror in interface IVec2I
Parameters:
lineDir - direction of reflection line

mirror

public IVec2 mirror(IVec2 linePt,
                    IVec2 lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Parameters:
linePt - start point of reflection line
lineDir - direction of reflection line

mirror

public IVec2 mirror(IVec2I linePt,
                    IVec2I lineDir)
reflect (mirror) 2 dimensionally to the other side of the line

Specified by:
mirror in interface IVec2I
Parameters:
linePt - start point of reflection line
lineDir - direction of reflection line

transform

public IVec2 transform(IVec2 xvec,
                       IVec2 yvec)

transform

public IVec2 transform(IVec2I xvec,
                       IVec2I yvec)
Specified by:
transform in interface IVec2I

transform

public IVec2 transform(IVec2 xvec,
                       IVec2 yvec,
                       IVec2 translate)

transform

public IVec2 transform(IVec2I xvec,
                       IVec2I yvec,
                       IVec2I translate)
Specified by:
transform in interface IVec2I

diff

public IVec2 diff(IVec2I v)
Specified by:
diff in interface IVec2I

mid

public IVec2 mid(IVec2I v)
Specified by:
mid in interface IVec2I

sum

public IVec2 sum(IVec2I v)
Specified by:
sum in interface IVec2I

sum

public IVec2 sum(IVec2I... v)
Specified by:
sum in interface IVec2I

bisect

public IVec2 bisect(IVec2 v)

bisect

public IVec2 bisect(IVec2I v)
Specified by:
bisect in interface IVec2I

sum

public IVec2 sum(IVec2 v2,
                 double w1,
                 double w2)
weighted sum


sum

public IVec2 sum(IVec2I v2,
                 double w1,
                 double w2)
Description copied from interface: IVec2I
weighted sum

Specified by:
sum in interface IVec2I

sum

public IVec2 sum(IVec2I v2,
                 IDoubleI w1,
                 IDoubleI w2)
Specified by:
sum in interface IVec2I

sum

public IVec2 sum(IVec2 v2,
                 double w2)

sum

public IVec2 sum(IVec2I v2,
                 double w2)
Specified by:
sum in interface IVec2I

sum

public IVec2 sum(IVec2I v2,
                 IDoubleI w2)
Specified by:
sum in interface IVec2I

isParallel

public boolean isParallel(IVec2I v)

isParallel

public boolean isParallel(IVec2I v,
                          double angleReso)

isStraight

public boolean isStraight(IVec2I v1,
                          IVec2I v2)

isStraight

public boolean isStraight(IVec2I v1,
                          IVec2I v2,
                          double angleReso)

intersect

public static IVec2 intersect(IVec2I pt1,
                              IVec2I dir1,
                              IVec2I pt2,
                              IVec2I dir2)

intersectYLine

public static IVec2 intersectYLine(IVec2 linePt,
                                   IVec2 lineDir,
                                   double xOfYLine)

intersectXLine

public static IVec2 intersectXLine(IVec2 linePt,
                                   IVec2 lineDir,
                                   double yOfXLine)

intersectSegment

public static IVec2 intersectSegment(IVec2I line1pt1,
                                     IVec2I line1pt2,
                                     IVec2I line2pt1,
                                     IVec2I line2pt2)

intersectPolyline

public static IVec2 intersectPolyline(IVec2I p1,
                                      IVec2I p2,
                                      IVec2I[] pts,
                                      boolean closed)

intersectPolyline

public static IVec2 intersectPolyline(IVec2I p1,
                                      IVec2I p2,
                                      IVec2I[] pts)

intersectPolygon

public static IVec2 intersectPolygon(IVec2I p1,
                                     IVec2I p2,
                                     IVec2I[] pts)

intersectSegmentAndXLine

public static IVec2 intersectSegmentAndXLine(IVec2I linePt1,
                                             IVec2I linePt2,
                                             double y)

intersectSegmentAndYLine

public static IVec2 intersectSegmentAndYLine(IVec2I linePt1,
                                             IVec2I linePt2,
                                             double x)

removeStraightPoints

public static IVec2I[] removeStraightPoints(IVec2I[] pts,
                                            boolean closed)
remove points which are on straight line of adjacents


removeDuplicatedPoints

public static IVec2I[] removeDuplicatedPoints(IVec2I[] pts,
                                              boolean closed)

isInside

public boolean isInside(IVec2I[] pts)
determine if the point is insde the polygon defined by the argument


isInside

public boolean isInside(IVec2[] pts)
determine if the point is insde the polygon defined by the argument true if the point is on the edge of polygon


toString

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

distToLine

public double distToLine(IVec2 pt1,
                         IVec2 pt2)

isOnLine

public boolean isOnLine(IVec2 pt1,
                        IVec2 pt2)

isBetween

public boolean isBetween(IVec2I pt1,
                         IVec2I pt2)