Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Thursday, February 18, 2010

Arcs

a rx ry x-axis-rotation large-arc-flag sweep-flag x y

/x-axis-rotation/ is (I think) the orientation of the minor (shorter) axis of the ellipse, measured clockwise with East being 0 deg. Obviously for an arc which is a portion of a circle, the rotation has no effect.

/large-arc-flag/ and /sweep-flag/ work together. To understand them you have to appreciate that there are always two possible circles or ellipses on whose circumference the start and end points can fall:
  • The circle where the shortest route from start to end is the anticlockwise one ('anticlockwise short')
  • The circle where the shortest route from start to end is the clockwise one ('clockwise short')

/large-arc-flag/ determines whether the longer, or the shorter path between the start and end points is used.

/sweep-flag/ determines which direction (0=negative/anticlockwise, 1=positive/clockwise) we move in round the circle when going from start to end.

Basically the combination of /large-arc-flag/ and /sweep-flag/ chooses between one of the possible circles and the other, and dictates whether we use the larger or smaller way round that circle.

That's to say, the combination 0 0 uses the same circle as 1 1 (anticlockwise short), and 0 1 uses the same circle as 1 0 (clockwise short) - and 0 1 and 1 1 take the long way round the chosen circle.

(Good diagram of this here)

NB that it is a lot easier to use the circle element instead of trying to draw a complete circle with arcs.

Followers

Blog Archive