Giter Site home page Giter Site logo

rectangles's Introduction

Module rectangle-bounds

Rectangles

A simple rectangle bounds utility set, working on the assumption of an Integer grid system, disallowing rotated rectangles

Technology Used

  • Kotlin
  • JUnit5
  • Dokka (documentation generator, not part of implementation)

Documentation

Aside from this README there is also the dokka pages generated from kdoc (equivalent of javadoc)

The Point implementation acts as a container for a single X and Y coordinate pair

Point offers the infix utility functions above, below, leftOf and rightOf to compare relative positions of two points.

Point also offers the infix function connectingTo to fluently create a line from two points

The Line implementation acts primarily as a utility for intersection and overlap testing

Line offers contains utility functions to test if a Line contains a point or wholly contains another Line

parallelTo checks if two lines are both horizontal or vertical

overlaps checks if two lines are parallel and have at least some points touching

intersects checks if two lines touch but are not parallel and returns where they touch

Rectangle implementation represents an entire rectangle by the four corners, but offers a utility to also get the edges of the rectangle as Lines

contains checks whether one rectangle wholly contains another

intersections finds all intersection Points of two rectangles

adjacent checks whether the rectangles have any overlapping lines (see Line documentation for overlapping)

rectangles's People

Contributors

jessecorbett avatar

Watchers

 avatar

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.