美文网首页
几何图形运算 - geometry

几何图形运算 - geometry

作者: 猿来是八阿哥 | 来源:发表于2019-07-31 11:12 被阅读0次

这个是自己写的一个几何图形运算的类库,已经开源。欢迎大家 start 或者提issue。
目前项目还在更新中,我会定时同步项目的 README.md 到这篇文章上的。

github: https://github.com/Guojunzhou-git/geometry

geometry

A php composer library of geometry operating

geometry\Point

1. Point Point::__construct(x, y);

  • Given x and y, return a Point instance

2. string Point::getUniqueLabel();

  • Generate a qunite string identification of Point

3. boolean Point::isInLine(Line line);

  • Return whether this point is in the target line

4. boolean Point::isInEdge(Edge edge);

  • Return whether this point is in the target edge

5. boolean Point::isSameWithPoint(Point point);

  • Return whethis this point has same x and same y with the target point

geometry\Line

1. Line Line::__construct(a, b, c);

  • Give the parameters of Line formula Ax+By+C=0, return a Line instance

2. Line Line::fromTwoPoint(Ponit p1, Point p2);

  • Return a Line instance by providing two different point

3. boolean Line::isPointOnLine(Point p);

  • Retrue whether the target Ponit in this line

4. GeometryException/boolean/Point Line::intersectWithLine(Line line);

  • Raise a GeometryException with code=11002 when two lines are the same
  • Return a boolean false when two lines are parallel
  • Reruen the intersection Point when two line intersects

geometry\Edge

1. Edge Edge::__constrct(Line line, xrange=[0,0], yrange=[0,0]);

  • Give a Line and the ranges of x and y, return an instance of Edge

2. Edge Edge::fromTwoEndpoint(Point p1, Point p2);

  • Give two points, return the Edge instance with endpoint given

3. boolea Edge::isPointOnEdge(Point p)

  • Return whether the given point on this Edge

4. GeometryException/boolean/Point Edge::intersectWithLine(Line line)

  • Raise a GeometryException with code=11002 when this edge is a part of line
  • Return a boolean false when edge is parallel with line
  • Reruen the intersection Point when edge intersects with line in its range

geometry\Polygon

1. Polygon Polygon::fromEndpoints(Point[] points);

  • Give the clockwise endpoints of polygon, return an instance of Polygon

2. boolean Polygon::isPointInPolygon(Point p)

  • Return whether the target Point in Polygon

相关文章

  • 几何图形运算 - geometry

    这个是自己写的一个几何图形运算的类库,已经开源。欢迎大家 start 或者提issue。目前项目还在更新中,我会定...

  • OpenGL ES基础一

    名词解释 pipleline:管线opengl applocation: geometry(几何图形) + tex...

  • geometry

    超级有趣的几何图形堆叠物理游戏!你准备好在这个geometry town游戏中开始最大的建设最大的几何楼吗? 特征...

  • 《iOS Core Animation Advanced Tec

    3. Layer Geometry Let no one unversed in geometry enter h...

  • JTS

    常用的Geometry数据结构 GeometryFactory GeometryFactory是geometry的...

  • 辛几何

    What? 辛几何是华罗庚对symplectic geometry的翻译。 symplectic geometry...

  • geometry

  • 二次函数综合题

    二次函数和几何图形综合题,难在两点,一几何图形中的转换,二是计算具体为整式根式一元二次方程的运算!你思维生活已经满...

  • latex geometry 页面设置

    资源 本文介绍如何使用 geometry 设置 LaTeX 文档页面。这里 是 geometry 在 github...

  • postgresql几何相关函数

    1.获取经纬度 纬度:st_x(geometry)经度:st_y(geometry) 2.wkt,geojson,...

网友评论

      本文标题:几何图形运算 - geometry

      本文链接:https://www.haomeiwen.com/subject/ivdzrctx.html