bfoz / geometry Goto Github PK
View Code? Open in Web Editor NEWGeometric primitives for Ruby
Home Page: https://rubygems.org/gems/geometry
License: BSD 2-Clause "Simplified" License
Geometric primitives for Ruby
Home Page: https://rubygems.org/gems/geometry
License: BSD 2-Clause "Simplified" License
Like a TwoPointLine, but not implicitly of infinite length
http://gvu.gatech.edu/people/official/jarek/graphics/papers/04PolygonBooleansMargalit.pdf
Union is already implemented. Do the others at some point.
Returns a Vector that's perpendicular to the Edge
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)
Rectangle[...] seems wrong now that I look at it again. Switch to the more standard Rectangle.new syntax.
Rectangle.new [-1,-1],[1,1] should == Rectangle.new Size[2,2]
Currently #== is aliased to #eql?
The current version is a skeleton that was rushed in support of the engineering gem.
Like Polygon#outset, but for Rectangle
Needs accessors, etc
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]
Like Point, but with a different name
Subclass of Rectangle?
Special subclasses that are always zero, always compare as zero and are compatible with Points and Sizes of any length.
Need to add Point#coerce
Like a Polygon, but not necessarily closed and not limited to straight lines
Represents the concept of a rotation regardless of the underlying implementation. Has methods for getting the equivalent rotation matrix and the equivalent quaternion.
Applies spaceship to each corresponding element and returns a new Point with the results
Monkeypatch it into Vector as well?
Two semicircles connected by parallel lines
Fix test framework for Line class
Returns an array of Points
eg. Point[0..1,1] would return [Point[0,1], Point[1,1]]
Adding two elements should return a Path that's the union of the elements, or an exception if they don't intersect.
A portion of a circle
Rectangle, Square, Obround, etc should take left, right, top, bottom, bottom_left, top_right, width, height, etc...
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.
Implement north, south, east, and west methods in addition to the existing up, down, left and right methods
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".
A Polygon that's constrained to be a regular polygon. Has accessors for radius and center.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.