hi, i want to know that if i know two sides of a triangle can i know the angle between two lines,there is no method in api such as tan inverse , cos inverse etc . please explain with an example its urgent . thanks in advance.
Prashant If you only know 2 sides that is not enough to be able to figure out the angle between them. For triangles, to calculate a missing side or angle, you need to hae three things: 2 angles and a side, 2 sides and an angle, 3 sides, or 3 angles. then you can use sin and cosine to figure out the missing peices. hope that helps
Perhaps you're thinking of a right triangle? Then you really know one angle (the right angle) and two sides. In that case, yes, it's possible - in Java the inverse trig functions are found in the Math class - asin(), acos(), atan(). Naturally theswe return values in radians, but you can convert the values to degrees if necessary. Hope that helps...
Originally posted by Jim Yingst: Perhaps you're thinking of a right triangle? Then you really know one angle (the right angle) and two sides. In that case, yes, it's possible - in Java the inverse trig functions are found in the Math class - asin(), acos(), atan(). Naturally theswe return values in radians, but you can convert the values to degrees if necessary. Hope that helps...
hi jim, thanks for ur reply but i think atan is not tan inverse.any othe r solution ?? prashant
Well, I'm quite certain that the atan or arc tan is the "tan inverse", if by that you mean the inverse tangent function, commonly written tan^{-1}. That is, if you input an argument, it returns a value representing an angle in radians between -pi/2 and pi/2 whose tangent is equal to the argument. What makes you think it's not the inverse tangent?
Originally posted by Jim Yingst: Well, I'm quite certain that the atan or arc tan is the "tan inverse", if by that you mean the inverse tangent function, commonly written tan^{-1}. That is, if you input an argument, it returns a value representing an angle in radians between -pi/2 and pi/2 whose tangent is equal to the argument. What makes you think it's not the inverse tangent?
ya jim, i got it thanks very much. actually when i put Math.atan(50/30) and then convert it to degrees it was coming out to be 45 deg that is wrong.thats why i was thinking it is not tan inverse. but when i put 50.0/30.0 in Math.atan it was giving correct value . Thanks again prashant
Sun Certified Programmer for Java 2 Platform
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop