This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Trying to calculate lines over pi/4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Trying to calculate lines over pi/4" Watch "Trying to calculate lines over pi/4" New topic
Author

Trying to calculate lines over pi/4

Tony Craven
Greenhorn

Joined: Aug 14, 2007
Posts: 7
Hi,

I'm trying to draw a visual representation of an array of sensors for a science project demonstration. The 7 sensors are at the front of a little bot.

I'm having trouble finding the right way to do it in java, I'm using Line2D.Double to represent each sensor but when it comes to spreading them out equally over the pi/4 range, I'm stumped.

I guess this is more a maths problem, than a java problem, but I'd really appreciate any help!

Thank you,

Tony


Never trust a computer you can't throw out a window - Steve Wozniak
Manuel Leiria
Ranch Hand

Joined: Jul 13, 2007
Posts: 171
Can you elaborate a little your problem?


Manuel Leiria<br /> <br />--------------<br />Peace cannot be kept by force; it can only be achieved by understanding. <br /> Albert Einstein
Tony Craven
Greenhorn

Joined: Aug 14, 2007
Posts: 7
Actually, I figured out how to do what I wanted in the end.

Briefly, starting at 90 degress.



And each sensor after that would be (45 / 7 * i), where i was the sensor number.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to calculate lines over pi/4