Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to calculate lines over pi/4

 
Tony Craven
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Manuel Leiria
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate a little your problem?
 
Tony Craven
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic