Link to home
Start Free TrialLog in
Avatar of darkpegasus5
darkpegasus5

asked on

How to draw a hexagon in java

This should be easy, but I'm having a difficult time finding the answer. I'm trying to draw a regular hexagon.

How do I draw a line 100 pixels long, then draw another line that is 100 pixels long at a 120 degree angle from where the first line ended?

If it's not much harder, what is the best way to draw an entire hexagon like this given the absolute center?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of darkpegasus5
darkpegasus5

ASKER

That worked perfectly, thanks.