peter
peter

Reputation: 2103

Rotate path data

This tiny little path data M 0 0 L 3.5 4 L 7 0 Z represents a very nice DownArrow:

enter image description here

How can I get the UpArrow path data from this, ie turn it 180°?

Upvotes: 0

Views: 763

Answers (3)

Franck
Franck

Reputation: 4440

Path is read as follow :

M is start of path , Z in end of path, L is a new point

M X1 Y1 L X2 Y2 L X3 Y3 Z

So Down arrow is :M 0 0 L 3.5 4 L 7 0 Z

then Up arrow is : M 0 0 L 3.5 -4 L 7 0 Z

Left can be : M 0 0 L -4 -3.5 L 0 -7 Z

And Right can be : M 0 0 L 4 -3.5 L 0 -7 Z

Edit : note that the Y increase as you go DOWN the screen and not like typical Cartesian graph

Upvotes: 2

Ben
Ben

Reputation: 935

Well the path data describes where the line starts: At x=0, y=0 (M 0 0) than going to x=3.5, y=4 continuing to x=7, y=0 and closing back to the origin with Z. So drawing the same arrow upwards you start at x=0, y=4 going to x=3.5, y=0, than x=7, y=4 than return

M 0 4 L 3.5 0 L 7 4 Z

Upvotes: 1

Peregrine
Peregrine

Reputation: 4546

Replace each y co-ordinate with 4 - y, giving ...

M 0 4 L 3.5 0 L 7 4 Z

Upvotes: 1

Related Questions