ScratchData LogoScratchData
Back to gtoal's profile

Circle + Shear = Ellipse

GTgtoal•Created February 26, 2015
Circle + Shear = Ellipse
11
5
301 views
View on Scratch

Instructions

GF. best viewed at zoom = 100% See an animated demo of the rotation-via-shearing algorithm at http://g6auc.me.uk/ellipses/index.html Full ellipse library at http://scratch.mit.edu/projects/50039326/

Description

This is the same code as http://scratch.mit.edu/projects/49800724/ except that it applies a shear to the Y coordinate that is proportional to the X coordinate. This results in an ellipse that has axes that are no longer axis-aligned. It's possible (see http://g6auc.me.uk/shear.htm) to define an ellipse-drawing procedure that takes the traditional 2 loci plus distance (or equivalently, two axes plus rotation) and maps that definition to the center and radius of a circle plus the needed shear parameters that distort it to match the desired ellipse. A more efficient implementation would combine Bresenham's line algorithm to do the shear with Bresenham's circle algorithm.

Project Details

Project ID49805378
CreatedFebruary 26, 2015
Last ModifiedAugust 1, 2016
SharedFebruary 26, 2015
Visibilityvisible
CommentsAllowed