And an overlay of starts with points ranging from 2 to 10:
reset
turnleft 90
$baseLength = 40
$starHeight = 60
$starLength = sqrt($starHeight * $starHeight + ($baseLength/2)*($baseLength/2))
for $x = 2 to 10 {
repeat $x {
# draw the base line
forward $baseLength
# calculate the angle of triangle at the bottom corner
$angle = arctan (($baseLength/2) / $starHeight)
# turn to draw the side
turnleft 90 + $angle
# draw the side
forward $starLength
# turn to draw the other side
turnleft 2 * (90 - $angle)
# draw the other side
forward $starLength
# turn to draw the base (again)
turnleft 90 + $angle
# draw the base (again)
forward $baseLength
# turn the turtle to start the next point
turnright 360 / $x
}
}



Thanks for your cammands but we cant paste the commands to kturtle programme
ReplyDelete