Google Answers Logo
View Question
 
Q: Static methods and variables ( Answered 1 out of 5 stars,   0 Comments )
Question  
Subject: Static methods and variables
Category: Computers > Programming
Asked by: lthames53-ga
List Price: $15.00
Posted: 30 Nov 2002 08:59 PST
Expires: 30 Dec 2002 08:59 PST
Question ID: 116808
How do I write a static method for distance between two points using Point2d?
Answer  
Subject: Re: Static methods and variables
Answered By: webadept-ga on 30 Nov 2002 09:55 PST
Rated:1 out of 5 stars
 
Hi, 


---
public abstract class Point2D
extends Object
implements Cloneable
The Point2D class defines a point representing a location in (x, y)
coordinate space.

This class is only the abstract superclass for all objects that store
a 2D coordinate. The actual storage representation of the coordinates
is left to the subclass.

----


distance
public static double distance(double X1,
                              double Y1,
                              double X2,
                              double Y2)Returns the distance between
two points.

Returns:
the distance between the two sets of specified coordinates.

---

Here's the webpage this is from:
http://java.sun.com/j2se/1.4/docs/api/java/awt/geom/Point2D.html

This page has a full explanation and some sample code of how to use
the class.

Java 2D Graphics, the Point2D Class
http://www.developer.com/net/net/article.php/626081


Other links of interest
Journal of Online Mathematics
http://www.joma.org/vol1-2/articles/yanik/javadocs/mathtoolkit/EDU.emporia.mathtools.Point2D.html

JPSP Developer Documentation
http://www.physci.org/PhySci/docs/physci/geometry/Geometry.html



Queries Used
Point2d +"distance between two points"
Point2d +"distance between two points" example code

Thanks, 

webadept-ga
lthames53-ga rated this answer:1 out of 5 stars
The reply to my question gave me nothing - I already had access to the
same sites which did nothing to explain how to set up the method.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy