# Difference between revisions of "For Tutorial 5"

From Progzoo

(→Less Regular Polygons) |
(→Less Regular Polygons) |
||

Line 105: | Line 105: | ||

{ | { | ||

double a = i*2*Math.PI/n; | double a = i*2*Math.PI/n; | ||

− | if (i==0 || i=2 || i==4) | + | if (i==0 || i==2 || i==4) |

r=40; | r=40; | ||

else | else |

## Revision as of 13:53, 8 October 2012

**Adding points to a Polygon**

## Regular Polygon

You can find the coordinates of a regular polygon using sin and cosine.

Change n and r so that you get a hexagon that is twice the size.

[Font]
[Default]
[Show]
[Resize]
[History]
[Profile]

## Octagons

[Font]
[Default]
[Show]
[Resize]
[History]
[Profile]