PHP Get Shape Coordinates From Points

Posted by Ozzy on Stack Overflow See other posts from Stack Overflow or by Ozzy
Published on 2010-03-27T13:09:54Z Indexed on 2010/03/27 13:13 UTC
Read the original article Hit count: 169

Filed under:
|
|
|

Im sure if the title is exactly what I am trying to describe so sorry if it isnt.

Ok here is what i am trying to do:

alt text

What i want to do is create a function that you can enter unlimited ammount of coordinates ( the blue dots) and then it will create a shape like so and then return all coordinates the shape covers. Because this is for working with pixels, there will be no decimal coordinates.

Something that can be used like so:

print_r(get_coords(12,6, 23,13, 30,9, 37,24, 24,34, 25,24, 7,30, 6,15));

// ^ Will output an array of all x and y coordinates that the shape covers

How would i go about doing something like this?

© Stack Overflow or respective owner

Related posts about php

Related posts about coordinates