Giter Club home page Giter Club logo

geometry's People

Contributors

bfoz avatar krzysiekherod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

geometry's Issues

Allow center==nil in equality checking

A Circle or RegularPolygon with a nil center should be equal to another class of the same type with the same radius or diameter (and number of sides, for RegularPolygon)

Fill out the Line class cluster

Needs accessors, etc

  • parallel? line - true if the passed line is parallel
  • intersect? line - true if the passed line intersects
  • angle - the angle between the two lines
  • direction - a vector pointing along the line
  • equal? line - true if collinear
  • distance
    • point - distance to the point
    • line - closest distance between the lines
    • circle - distance to the circle's center minus its radius

Module convenience methods

  • pentagon - returns a regular pentagon
  • hexagon - returns a regular hexagon
  • regular_polygon - constructs a regular polygon with a specified number of edges

Add min, max, and minmax methods to Rectangle

min returns a Point that's on the Rectangle and closest to the origin
max returns a Point that's on the Rectangle and farthest from the origin
minmax returns the Array of Points [min, max]

Fill out the Polygon class cluster

Methods

  • inside?
    • checks if a passed point is inside, or on the boundary
    • checks if a passed edge is entirely inside, or on the boundary
    • checks if a passed polygon is entirely inside, or matches the boundary entirely
  • outside? - opposite of inside?
  • intersect?
    • true if passed line intersects the polygon
    • true if any part of the passed polygon is inside?
  • equal? polygon - true if passed polygon has same vertices, and number of vertices
  • on_boundary?
    • true if passed point is a vertex or on an edge
    • true if passed line is an edge or entirely on an edge
    • true if passed polygon is equal?
  • vertex? point - true if passed point is a vertex of the polygon
  • edge? line - true if passed line is an edge of the vertex
  • edge? point - true if passed point in on any edge
  • concave?
  • convex?
  • decompose - cuts a concave polygon into 1 or more convex polygons
  • hull - creates a convex hull
  • square - smallest enclosing Square
  • rectangle - smallest enclosing Rectangle

Cluster

  • RegularPolygon

Add a Path class

Like a Polygon, but not necessarily closed and not limited to straight lines

Add a Rotation class

Represents the concept of a rotation regardless of the underlying implementation. Has methods for getting the equivalent rotation matrix and the equivalent quaternion.

Line testing

Fix test framework for Line class

  • Rename file
  • Rename test case (not a Point test)
  • Add test cases for individual cluster classes

Composition

Adding two elements should return a Path that's the union of the elements, or an exception if they don't intersect.

Add RegularPolygon#circle

circle should return a Circle that encloses the RegularPolygon

incircle should return a Circle that incribes the RegularPolygon

Add a PolyLine class

A sequence of Edges that may, or may not, be closed. It's like a Polygon in that it only contains straight lines, but also like a Path in that it isn't necessarily closed.

Add an inset method to Rectangle

Generates a new Rectangle that's inset by the specified amount. Overloads for single inset all around, horizontal/vertical insets, and top/left/bottom/right insets. Negative numbers produce an "outset".

RegularPolygon

A Polygon that's constrained to be a regular polygon. Has accessors for radius and center.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.