• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Equilateral Triangle

 
Ivan Au
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I got two problems here, anybody got the same problem before?
1. Every time I set the background color of an applet "setBackground(Color.red)" , the line color of lines drawn by drawLine is reset to black.

2. I got the center and one of the corner of a equilateral triangle. How can I find the other two corners and draw the triangle on an applet?
 
Sahir Shah
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The line from the corner to the centre point is the hypotenuse of six right angled triangles that are formed by the lines that bisect the vertices. You can try creating the internal triangles by drawing a line at a 30 degree angle from the corner point and then drawing a perpendicular from the centrepoint to the newly drawn line.
Rgds
Sahir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic