wood burning stoves
The moose likes Beginning Java and the fly likes HELP ME Square root please!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HELP ME Square root please!!!" Watch "HELP ME Square root please!!!" New topic

HELP ME Square root please!!!

Rico jamz

Joined: Nov 01, 2003
Posts: 6
Hi guys,
Im new at Java,. I have an assignment due that needs me to find the square root of a number. I need to find the library that this function is in and how to use it. and also i need to know if there is an algorithm i could use instead of the library..

this is the method that i have which need s this code
static void area (point point1, point point2, point point3){

double area, semi;
double a, b, c;
a= length (point1, point2);
b= length (point2, point3);
c= length (point1, point3);

semi = (a + b + c)/2;

area = sqrt( semi * (semi - a)*(semi-b)*(semi-c));

chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
you can use the Math.sqrt(double d).
[ November 01, 2003: Message edited by: chi Lin ]

not so smart guy still curious to learn new stuff every now and then
Rico jamz

Joined: Nov 01, 2003
Posts: 6
thansk you
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Rico jamz,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: HELP ME Square root please!!!
It's not a secret anymore!