开发者

PHP Get Shape Coordinates From Points

开发者 https://www.devze.com 2022-12-24 16:23 出处:网络
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:

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:

PHP Get Shape Coordinates From Points

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 d开发者_JAVA百科oing something like this?


http://php.net/imagefilledpolygon

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号