triangle

Help Contents Turtle Graphics triangle
setxy 3D Turtle Graphics

triangle :pos :ang


constructs a special isosceles triangle object at position :pos pointing to the angle :ang.

This is the default :shape of every turtle.

Definition:

to triangle :pos :ang

	local "shoulder "head "base "left "right

	make "shoulder (point  0 5)°:ang
	make "head     (point 15 0)°:ang

	make "base  segment :pos+:shoulder :pos-:shoulder
	make "left  segment :pos+:head :base.initial
	make "right segment :pos+:head :base.final

	to ondrawimage
		base.ondrawimage
		left.ondrawimage
		right.ondrawimage
	end
end

Examples:

References:

setxy 3D Turtle Graphics