objects
Class EuLine

java.lang.Object
  |
  +--objects.EuObject
        |
        +--objects.EuParametrized
              |
              +--objects.EuLine
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
EuHalf, EuInterval

public class EuLine
extends EuParametrized
implements java.lang.Cloneable

An instance of this class represents a line, represented as two cartesian pairs.


Field Summary
 fundamentals.EuVector generator
          A generating vector of the line.
 
Fields inherited from class objects.EuParametrized
anchor
 
Fields inherited from class objects.EuObject
infoHash, provenience, scaledown
 
Constructor Summary
EuLine()
          Contructor for dummy object
EuLine(double x, double y, double theta)
          The constructor does initialization.
EuLine(double x, double y, double deltax, double deltay)
          The constructor does initialization.
EuLine(objects.EuLine other)
          Creates a new EuLine instance.
EuLine(objects.EuPoint p1, objects.EuPoint p2)
          The line is instantiated through the two given points
 
Method Summary
 fundamentals.EuVector atParameter(double t)
          Return in a EuVector the coordinates of a point on the line at a given parameter.
 boolean castIdentical(objects.EuObject other)
          See if passed object can be cast to the present one.
 objects.EuLine cloneMe()
          Describe cloneMe method here.
 double closestParameter(double x, double y)
          Find the parameter value which yields the closest point to a given one.
 double closestParameterOnLine(double x, double y)
          Describe closestParameterOnLine method here.
 objects.plotCollection computeClip(fundamentals.mouseInfo info)
          Compute the visible portion of the object as a collection of arcs, intervals or points.
 double confusionDistance(objects.EuObject other)
          Returns the distance from this object to another under these simplifications: The distance to lines or circles is in {0,POSITIVE_INFINITY} unless this is a point.
protected  fundamentals.EuVector invisibleRandomPoint(fundamentals.mouseInfo info, java.util.Random croupier)
          Chooses a sensible point on the line when the line is invisible.
 boolean isFull()
          Describe isFull method here.
 double nameDisplacementAngle(fundamentals.mouseInfo info)
          Describe nameDisplacementAngle method here.
 double nameParameter(fundamentals.mouseInfo info)
          Describe nameParameter method here.
protected  boolean onSameLine(objects.EuLine other)
          Describe onSameLine method here.
 boolean overlaps(objects.EuObject other)
          Acts identically to castIdentical()
 java.lang.String params()
          Describe params method here.
 void passArguments(fundamentals.EuArguments args)
          Describe passArguments method here.
 boolean superIdentical(objects.EuObject other)
          See if passed object can be cast to the present one.
 java.lang.String toNaturalLanguage(int language, boolean determined)
          Describe toNaturalLanguage method here.
 java.lang.String toString()
          Describe toString method here.
 char typeName()
          Describe typeName method here.
 
Methods inherited from class objects.EuParametrized
atParameter, atParameter, closestParameter, closureContains, distance, interiorContains, matchingPair, nameLocation, randomPoint
 
Methods inherited from class objects.EuObject
cloneObject, draw, equals, getClip, isVisible, mouseVicinity, mouseVicinity, toPs
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

generator

public fundamentals.EuVector generator
A generating vector of the line. Is normalized to be a unit vector.

Constructor Detail

EuLine

public EuLine(double x,
              double y,
              double deltax,
              double deltay)
       throws UserException
The constructor does initialization. A zero generator vector gives a LeaRuntimeException

Parameters:
x - the first coordinate of anchor
y - the second coordinate of anchor
deltax - the first coordinate of generator
deltay - the second coordinate of generator
Throws:
UserException - if an error occurs

EuLine

public EuLine(double x,
              double y,
              double theta)
       throws UserException
The constructor does initialization.

Parameters:
x - the first coordinate of anchor
y - the second coordinate of anchor
theta - the angle of the generator
Throws:
UserException - if an error occurs

EuLine

public EuLine(objects.EuLine other)
Creates a new EuLine instance.

Parameters:
other - an EuLine value

EuLine

public EuLine()
Contructor for dummy object


EuLine

public EuLine(objects.EuPoint p1,
              objects.EuPoint p2)
       throws UserException
The line is instantiated through the two given points

Parameters:
p1 - an EuPoint value
p2 - an EuPoint value
Throws:
UserException - if an error occurs
Method Detail

atParameter

public fundamentals.EuVector atParameter(double t)
Return in a EuVector the coordinates of a point on the line at a given parameter.

Specified by:
atParameter in class EuParametrized
Parameters:
t - the parameter
Returns:
the coordinates

closestParameter

public double closestParameter(double x,
                               double y)
Find the parameter value which yields the closest point to a given one.

Specified by:
closestParameter in class EuParametrized
Parameters:
x - The first coordinate of the given point
y - The second coordinate of the given point
Returns:
The parameter

closestParameterOnLine

public double closestParameterOnLine(double x,
                                     double y)
Describe closestParameterOnLine method here.

Parameters:
x - a double value
y - a double value
Returns:
a double value

computeClip

public objects.plotCollection computeClip(fundamentals.mouseInfo info)
                                   throws UserException
Compute the visible portion of the object as a collection of arcs, intervals or points.

Specified by:
computeClip in class EuObject
Parameters:
info - information used in scaling and positioning the object
Returns:
a plotCollection value
Throws:
UserException - if an error occurs

invisibleRandomPoint

protected fundamentals.EuVector invisibleRandomPoint(fundamentals.mouseInfo info,
                                                     java.util.Random croupier)
                                              throws UserException
Chooses a sensible point on the line when the line is invisible.

Specified by:
invisibleRandomPoint in class EuParametrized
Parameters:
info - a mouseInfo value
croupier - a Random value
Returns:
an EuVector value
Throws:
UserException - if an error occurs

castIdentical

public boolean castIdentical(objects.EuObject other)
See if passed object can be cast to the present one.

Specified by:
castIdentical in class EuObject
Parameters:
other - an EuObject value
Returns:
true if passed object is a EuLine, EuHalf or EuInterval which is a subset of this one @param other the object being compared to the present one

superIdentical

public boolean superIdentical(objects.EuObject other)
See if passed object can be cast to the present one.

Parameters:
other - an EuObject value
Returns:
true if passed object is a EuLine, EuHalf or EuInterval which is a subset of this one @param other the object being compared to the present one

onSameLine

protected boolean onSameLine(objects.EuLine other)
Describe onSameLine method here.

Parameters:
other - an EuLine value
Returns:
a boolean value

overlaps

public boolean overlaps(objects.EuObject other)
Acts identically to castIdentical()

Specified by:
overlaps in class EuObject
Parameters:
other - an EuObject value
Returns:
true if passed object is a EuLine, EuHalf or EuInterval which is a subset of this one @param other the object being compared to the present one

confusionDistance

public double confusionDistance(objects.EuObject other)
Returns the distance from this object to another under these simplifications: The distance to lines or circles is in {0,POSITIVE_INFINITY} unless this is a point. The distance to radii is POSITIVE_INFINITY unless this is a radius The distance to points is POSITIVE_INFINITY if this is a radius

Overrides:
confusionDistance in class EuParametrized
Parameters:
other - an EuObject value
Returns:
the parameter or zero

typeName

public char typeName()
Describe typeName method here.

Specified by:
typeName in class EuObject
Returns:
L

isFull

public boolean isFull()
Describe isFull method here.

Specified by:
isFull in class EuObject
Returns:
true since the item is of subtype A_RADIUS, A_POINT, A_LINE, A_CIRCLE

params

public java.lang.String params()
Describe params method here.

Overrides:
params in class EuParametrized
Returns:
A technical specification of parameters associated to the object

toString

public java.lang.String toString()
Describe toString method here.

Specified by:
toString in class EuObject
Returns:
A technical specification of the object

cloneMe

public objects.EuLine cloneMe()
Describe cloneMe method here.

Returns:
an EuLine value

passArguments

public void passArguments(fundamentals.EuArguments args)
Describe passArguments method here.

Overrides:
passArguments in class EuParametrized
Parameters:
args - an EuArguments value

toNaturalLanguage

public java.lang.String toNaturalLanguage(int language,
                                          boolean determined)
Describe toNaturalLanguage method here.

Specified by:
toNaturalLanguage in class EuObject
Parameters:
language - an int value
determined - a boolean value
Returns:
a String value

nameDisplacementAngle

public double nameDisplacementAngle(fundamentals.mouseInfo info)
Describe nameDisplacementAngle method here.

Specified by:
nameDisplacementAngle in class EuObject
Parameters:
info - a mouseInfo value
Returns:
a double value

nameParameter

public double nameParameter(fundamentals.mouseInfo info)
Describe nameParameter method here. REDO!!!

Specified by:
nameParameter in class EuParametrized
Parameters:
info - a mouseInfo value
Returns:
a double value