承接 anton-panfilov/1d-integer-geometry 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anton-panfilov/1d-integer-geometry

最新稳定版本:1.4.0

Composer 安装命令:

composer require anton-panfilov/1d-integer-geometry

包简介

README 文档

README

The 1D Integer Geometry Library, anton-panfilov/1d-integer-geometry, provides a comprehensive set of tools for performing geometric operations on 1-dimensional integer shapes. This includes functionality for determining intersections, exclusions, and sorting of geometric shapes such as points, segments, and vectors. The library is designed to be intuitive and easy to use, catering to a wide range of applications in computational geometry, computer graphics, and related fields.

Key Features

  • Exclusion: Compute the geometric difference between shapes, effectively excluding one shape from another.
  • Intersection: Determine whether two shapes intersect and obtaining the shape obtained at the intersection.
  • Shapes: Create and manipulate basic 1D geometric shapes, including points, segments, and vectors.

Installation

The library can be installed using Composer, a dependency manager for PHP. To add the 1D Integer Geometry Library to your project, run the following command in your project's root directory:

composer require anton-panfilov/1d-integer-geometry

Usage

Excluding shapes

$result = Exclude::exclude(
    Shape::s(-9, 5),
    Shape::s(-10, 10)
);

Get the shape obtained by intersection

$result = Intersects::getIntersectsShape(
    Shape::s(0, 10),
    Shape::s(5, 15)
);
// Shape::s(5, 10)

$result = Intersects::getIntersectsShape(
    Shape::s(0, 10),
    Shape::s(10, 15)
);
// Shape::p(10)

Check if the figures intersect

$result = Intersects::intersectsShapes(
    Shape::p(10),
    Shape::s(5, 34)
);
// true

$result = Intersects::intersectsShapes(
    Shape::vp(10),
    Shape::s(5, 7)
);
// false

Creating Shapes

$point = Shape::p(10);
$segment = Shape::s(-9, 5);

// Convert Point or Segment to Segment (with point1 <= point2)
$segment = Shape::segment_strict(Shape::p(5)); // expected: Shape::s(5, 5)

For more detailed documentation on each feature, refer to the respective files in the docs directory:

Contributing

Contributions to the 1D Integer Geometry Library are welcome. Please refer to the contributing guidelines for more information.

License

This library is released under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 111
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-15