Code Sketch
BirdTangram
Category: Art
cleari
//Bird
//showAxes()
//showGrid()
tangram.draw
def tangram = picStack(
Picture {},
square.thatsFilledWith(Color(0, 106, 0)).thatsTranslated(0, 100),
triangle1.thatsFilledWith(green).thatsRotated(90).thatsTranslated(50, -50),
triangle2.thatsFilledWith(red).thatsRotated(90+45).thatsTranslated(0, -140),
triangle2.thatsFilledWith(yellow).thatsRotated(90).thatsTranslated(-100, -100),
triangle3.thatsFilledWith(cm.gray).thatsRotated(-90-45).thatsTranslated(0, 130),
parallelogram.thatsFilledWith(pink).thatsRotated(-45+45).thatsTranslated(0, 100).withFlippedX,
triangle4.thatsFilledWith(blue).thatsRotated(90+45).thatsTranslated(0, 0),
)
def square = Picture{
right(135)
forward(70.71)
right(90)
forward(70.71)
right(90)
forward(70.71)
right(90)
forward(70.71)
right(90)
}.thatsStrokeColored(black)
def triangle1 = Picture{
right()
forward(100)
left(135)
forward(70.71)
left(90)
forward(70.71)
}.thatsStrokeColored(black)
def triangle2 = Picture{
right(135)
forward(141.42)
left(135)
forward(200)
left(135)
forward(141.42)
}.thatsStrokeColored(black)
def triangle3 = Picture{
left(45)
forward(70.71)
left(135)
forward(100)
left(135)
forward(70.71)
}.thatsStrokeColored(black)
def parallelogram = Picture{
forward(100)
right(135)
forward(70.71)
right(45)
forward(100)
right(135)
forward(70.71)
}.thatsStrokeColored(black)
def triangle4 = Picture {
left(45)
forward(141.42)
left(135)
forward(100)
left(90)
forward(100)
}.thatsStrokeColored(black)