Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drawGrid20x20On: aCanvas
- | radius_squared |
- active
- ifFalse: [^self].
- radius_squared := self radius squared.
- aCanvas
- strokeWidth: 1 color: Color veryLightGray
- do: [ :canvas |
- -120 to: 120 by: 20 do: [:eachX |
- | edge |
- edge := (radius_squared - eachX squared) sqrt.
- canvas moveTo: eachX @ edge negated;
- lineTo:eachX @ edge].
- -120 to: 120 by: 20 do: [:eachY |
- | edge |
- edge := (radius_squared - eachY squared) sqrt.
- canvas
- moveTo: edge negated @ eachY;
- lineTo: edge @ eachY]].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement