PHP 从点获取形状坐标

发布于 2024-08-26 23:49:06 字数 497 浏览 4 评论 0原文

我确定标题是否正是我想要描述的内容,如果不是,很抱歉。

好的,这就是我想要做的:

替代文字

我想要做的是创建一个函数,您可以输入无限数量的坐标(蓝点),然后它将创建一个像这样的形状,然后返回形状覆盖的所有坐标。因为这是为了处理像素,所以不会有小数坐标。

可以这样使用的东西:

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

我将如何去做这样的事情?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文