• Post Reply Bookmark Topic Watch Topic
  • New Topic

Graphics2D line restraint  RSS feed

 
Evan Pierce
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have this app where it draws a line from an object to where your mouse is but i want to make it so that the line can only be so long, how could i do this?
 
sven studde
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think: Pythagorean formula.
 
Evan Pierce
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aaah. that seems like a way to go about it, i saw a show once on arcamedises where they talked about how he would use triangles and such to measure circles. but that all seems out of my grasp of math. there isnt any function that could help me? i was looking through the api and saw this clip function in Graphics2d would that have any relevence?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!