aspose file tools*
The moose likes Beginning Java and the fly likes Calculate length of line. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calculate length of line." Watch "Calculate length of line." New topic
Author

Calculate length of line.

Jan L
Greenhorn

Joined: Apr 30, 2001
Posts: 3
Does someone now how i can calculate the length of a line between
the points (X1, Y1) and (X2, Y2) on an applet?
Thanks!


J.L
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241

In other words, take the square of the difference of your x's plus the square of the difference of the y's, and the length will be the positive square root of that sum. At heart, it's the Pythagorean theorem.
Good luck,
Art
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"Jan L",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
Thanks.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calculate length of line.
 
Similar Threads
if Statements the best?
max value of an array
Reading the Portion of the file with the line numbes.
About array in Java
Adding strings together