GithubHelp home page GithubHelp logo

affinespaces.jl's Introduction

AffineSpaces

The perfect Julia package for those who love being pedantic about points

Build Status

`abstract AffineSpace{T}``

An AffineSpace object represents points in an affine space, which is similar to a Cartesian space but where no special meaning can be assigned to the origin. Subtypes of AffineSpace should have a field named pos with vector-like abilities describing the coordinates.

The consequences are that points do not have vector-like abilities such as multiplication by a scalar (scaling the distance relative to the origin), unary inversion (reflection about the origin) or addition of the coordinates of two points (coordinates being relative to the origin).

Outside these restriction, one can take affine combinations of points, finding for instance the midpoint of two points. Affine combinations are built with the colon operation p₁:p₂ and indexed with a scalar (p₁:p₂)[i], where i = 0.0 indicates the point p₁, and i = 1.0 indicates the point p₂, and other values of i trace out the line connecting the two points. Generally, the affine combination of n points can be generated with (p₁:...:pₙ)[i₁,...,iₙ] so long as the iⱼs sum to 1 (or the last iₙ is not given, and is automatically calculated).

Furthermore, standard vectors can be added and subtracted from affine points as a displacement of the point. The displacement vector between two points is given by their subtraction.

The goal of these types are to provide some programmer safety to avoid conceptual mistakes regarding manipulation of points, by removing the meaning of the possibly-arbitrary origin.

AffinePoint{N,T} <: FixedAffineSpace{T}

A concrete type describing a point in an affine space, where the Cartesian coordinates of the point are stored in a FixedSizeArrays.Vec{N,T}. See AffineSpace for a description of the interface for affine points.

affinespaces.jl's People

Stargazers

 avatar

Watchers

 avatar  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.