Java Doc for Line.java in  » GIS » GeoTools-2.4.1 » org » geotools » math » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.math 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.math.Line

Line
public class Line implements Cloneable,Serializable(Code)
Equation of a line in a two dimensional space (x,y). A line has an equation of the form y=ax+b. At the difference of Line2D (which are bounded by (x1,y1) and (x2,y2) points), Line objects extends toward infinity. The equation parameters for a Line object can bet set at construction time or using one of the setLine(...) methods. The y value can be computed for a given x value using the Line.y method. Method Line.x compute the converse and should work even if the line is vertical.
version:
   $Id: Line.java 22443 2006-10-27 20:47:22Z desruisseaux $
author:
   Martin Desruisseaux
since:
   2.0
See Also:   Point2D
See Also:   Line2D
See Also:   Plane



Constructor Summary
public  Line()
     Construct an initially unitialized line.
public  Line(double slope, double y0)
     Construct a line with the specified slope and offset.

Method Summary
public  Objectclone()
     Returns a clone of this line.
public  booleanequals(Object object)
     Compare this object with the specified one for equality.
final public  doublegetSlope()
     Returns the slope.
final public  doublegetX0()
     Returns the x value for y==0.
final public  doublegetY0()
     Returns the y value for x==0.
public  inthashCode()
     Returns a hash code value for this line.
public  Point2DintersectionPoint(Line line)
     Returns the intersection point between this line and the specified one. If both lines are parallel, then this method returns null .
Parameters:
  line - The line to intersect.
public  Point2DintersectionPoint(Line2D line)
     Returns the intersection point between this line and the specified bounded line. If both lines are parallel or if the specified line doesn't reach this line (since Line2D do not extends toward infinities), then this method returns null .
Parameters:
  line - The bounded line to intersect.
public  Line2DisoscelesTriangleBase(Point2D summit, double sideLength)
     Compute the base of a isosceles triangle having the specified summit and side length. The base will be colinear with this line.
public  Point2DnearestColinearPoint(Point2D point)
     Returns the nearest point on this line from the specified point.
Parameters:
  point - An arbitrary point.
public  voidsetLine(double slope, double y0)
     Set the slope and offset for this line.
public  voidsetLine(Line2D line)
     Set a line colinear with the specified line segment.
public  voidsetLine(Point2D p1, Point2D p2)
     Set a line through the specified point.
public  doublesetLine(double[] x, double[] y)
     Given a set of data points x[0..ndata-1] , y[0..ndata-1] , fit them to a straight line y=b+mx in a least-squares senses.
public  StringtoString()
     Returns a string representation of this line.
public  voidtranslate(double dx, double dy)
     Translate the line.
final public  doublex(double y)
     Compute x=f-1(y). If the line is horizontal, then this method returns an infinite value. This method is final for performance reason.
Parameters:
  y - The y value.
final public  doubley(double x)
     Compute y=f(x). If the line is vertical, then this method returns an infinite value. This method is final for performance reason.
Parameters:
  x - The x value.


Constructor Detail
Line
public Line()(Code)
Construct an initially unitialized line. All methods will returns Double.NaN .



Line
public Line(double slope, double y0)(Code)
Construct a line with the specified slope and offset. The linear equation will be y=slope*x+y0.
Parameters:
  slope - The slope.
Parameters:
  y0 - The y value at x==0.
See Also:   Line.setLine(double,double)




Method Detail
clone
public Object clone()(Code)
Returns a clone of this line.



equals
public boolean equals(Object object)(Code)
Compare this object with the specified one for equality.



getSlope
final public double getSlope()(Code)
Returns the slope.



getX0
final public double getX0()(Code)
Returns the x value for y==0. Coordinate (x0,0) is the intersection point with the x axis.



getY0
final public double getY0()(Code)
Returns the y value for x==0. Coordinate (0, y0) is the intersection point with the y axis.



hashCode
public int hashCode()(Code)
Returns a hash code value for this line.



intersectionPoint
public Point2D intersectionPoint(Line line)(Code)
Returns the intersection point between this line and the specified one. If both lines are parallel, then this method returns null .
Parameters:
  line - The line to intersect. The intersection point, or null .



intersectionPoint
public Point2D intersectionPoint(Line2D line)(Code)
Returns the intersection point between this line and the specified bounded line. If both lines are parallel or if the specified line doesn't reach this line (since Line2D do not extends toward infinities), then this method returns null .
Parameters:
  line - The bounded line to intersect. The intersection point, or null .



isoscelesTriangleBase
public Line2D isoscelesTriangleBase(Point2D summit, double sideLength)(Code)
Compute the base of a isosceles triangle having the specified summit and side length. The base will be colinear with this line. In other words, this method compute two points (x1,y1) and (x2,y2) located in such a way that:
  • Both points are on this line.
  • The distance between any of the two points and the specified summit is exactly sideLength .

Parameters:
  summit - The summit of the isosceles triangle.
Parameters:
  sideLength - The length for the two sides of the isosceles triangle. The base of the isoscele triangle, colinear with this line, or null if the base can't be computed. If non-null, then the triangle is the figure formedby joining (x1,y1), (x2,y2) and summit .



nearestColinearPoint
public Point2D nearestColinearPoint(Point2D point)(Code)
Returns the nearest point on this line from the specified point.
Parameters:
  point - An arbitrary point. The point on this line which is the nearest of the specified point .



setLine
public void setLine(double slope, double y0)(Code)
Set the slope and offset for this line. The linear equation will be y=slope*x+y0.
Parameters:
  slope - The slope.
Parameters:
  y0 - The y value at x==0.
See Also:   Line.setLine(Point2D,Point2D)
See Also:   Line.setLine(Line2D)
See Also:   Line.setLine(double[],double[])



setLine
public void setLine(Line2D line)(Code)
Set a line colinear with the specified line segment. The line will continues toward infinity after the line segment extremities.
Parameters:
  line - The line segment.
See Also:   Line.setLine(Point2D,Point2D)



setLine
public void setLine(Point2D p1, Point2D p2)(Code)
Set a line through the specified point. The line will continues toward infinity after the point.
Parameters:
  p1 - Coordinate of the first point.
Parameters:
  p2 - Coordinate of the second point.
See Also:   Line.setLine(Line2D)



setLine
public double setLine(double[] x, double[] y) throws MismatchedSizeException(Code)
Given a set of data points x[0..ndata-1] , y[0..ndata-1] , fit them to a straight line y=b+mx in a least-squares senses. This method assume that the x values are precise and all uncertainty is in y.

Reference: Linear Regression Curve Fitting.
Parameters:
  x - Vector of x values (independant variable).
Parameters:
  y - Vector of y values (dependant variable). Estimation of the correlation coefficient. The closerthis coefficient is to 1, the better the fit.
throws:
  MismatchedSizeException - if x and y don't have the same length.




toString
public String toString()(Code)
Returns a string representation of this line. This method returns the linear equation in the form "y=m*x+b". A string representation of this line.



translate
public void translate(double dx, double dy)(Code)
Translate the line. The slope stay unchanged.
Parameters:
  dx - The horizontal translation.
Parameters:
  dy - The vertical translation.



x
final public double x(double y)(Code)
Compute x=f-1(y). If the line is horizontal, then this method returns an infinite value. This method is final for performance reason.
Parameters:
  y - The y value. The x value.
See Also:   Line.y(double)



y
final public double y(double x)(Code)
Compute y=f(x). If the line is vertical, then this method returns an infinite value. This method is final for performance reason.
Parameters:
  x - The x value. The y value.
See Also:   Line.x(double)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.