rjp / ruby-geometry Goto Github PK
View Code? Open in Web Editor NEWThis project forked from richardkmichael/ruby-geometry
Simple geometry classes and algorithms in Ruby
License: MIT License
This project forked from richardkmichael/ruby-geometry
Simple geometry classes and algorithms in Ruby
License: MIT License
Geometry in Ruby ================ Implementation of basic 2D geometry algorithms in Ruby. Defined geometry objects ======================== * Point * Segment * Vector * Rectangle * Polygon * Line Already implemented algorithms ============================== * Do segments overlap? { Segments.overlaps? } * Do segments lie on one line? { Segment.lies_on_one_line_with? } * Do segments intersect? { Segment.intersects_with? } * Segments intersection point { Segment.intersection_point_with } * Does segment contain given point? { Segment.contains_point? } * Are segments parallel? { Segment.parallel_to? } * Are vectors collinear? { Vector.collinear_with? } * Vectors cross product (outer product, vector product) { Vector.cross_product } * Vectors scalar product (inner product, dot product) { Vector.scalar_product } * Segment length { Segment.length } * Vector modulus { Vector.modulus } * Trivial vector arithmetics: summation, subtraction, vector-number multiplication { Vector.+(vector); Vector.-(vector); Vector.*(numeric) } * Euclid distance { Geometry.distance } * Line slope { Line.slope } * Y-intercept of a line { Line.y_intercept } * X-intercept of a line { Line.x_intercept } * Are lines parallel? { Line.parallel_to? } * What x-value do lines intersect at? { Line.intersect_x } * What is the angle between two lines? { Line.angle_to } * Rectangle area * Do rectangles intersect? Coming up ========= * Is polygon self-intersecting? * Area of polygon * Is polygon convex? * Do polygons intersect? * Does polygon contain given point? * Rectangular bounds of polygon * Does circle contain given point? * Do circles intersect? * Area of circle * Making a ruby gem Copyright (c) 2008 Daniel Vartanov, released under the MIT license
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.