Giter Club home page Giter Club logo

jsblades's Introduction

jsBlades (Geometric Algebra)

jsBlades is a utility library for Geometric Algebra computations and modelling in JavaScript.

How to use this Library

Stay tuned...

What is Geometric Algebra?

Geometric Algebra is based on the Abstract Algebra work of Hestenes, Clifford, Graßmann, and others. In classical Euclidean Algebra the Vector Space is denoted as an extension of the Vector Field over the Set of Real Values or Complex Values.

These are the standard vector-based coordinate-systems that are used throughout contemporary 20th/21st-Century science and engineering. Yet, one of the many mathematical limitations of a Vector Space is that while an Inner-Product is generic for any data dimensionality, there is no similarly generic Outer-Product.

There is a Cross Product defined exclusively for 3-dimensional data, but its computation-algorithm is not extensible to other dimensionalities.

Geometric Algebra introduces the generalized/abstracted concept of vectors known as "blades", which support Interior, Exterior, Inner, Outer, Scalar, and Geometric Product operations.

In Geometric Algebra a blade is a local volume of local-dimensionality within the dimensionality of an Algebraic Space.

This is a different approach to computations and modelling than Classical Linear Algebra, so it may be easier to understand through an introductory example, as provided in the next section.

Example (Euclidean)

For example, let's look at the Euclidean Space of 3-dimensions. We will symbolically defer to this Space-Dimensionality by the letter n. So in this case we have: n = 3.

By Geometric Algebra definitions, this Space supports blades (spatial-volumes) of local-dimensionalities from 0 up through 3. The local-Dimensionality of a blade is colloquially referred to as its grade or gradality. Thus, the gradality of all blades in this example Space are within the set of {0, 1, 2, 3}, which actually correspond to the following volumes:

Gradality (k) Volume Type
0 Point
1 Line-Segment
2 Parallelogram
3 Parallelepiped

We also note that under Euclidean Algebra, we have the Euclidean Distance metric that explicitly defines uniqueness of data-points in the Space, such that each data-point is defined by an algebraic tuple of length 3, in this example. The length of the elemental Algebraic tuples is colloquially known as the plicality of a Set Element. In this definition, we are using blades as those Elements, and under a Euclidean Space the Space-Dimensionality and the Algebraic Plicality are equivalent by construction. So, even though we would refer to the plicality symbolically with a lowercase-L (l), in this case we have n = l = 3.

plica refers to a "fold" or a "crease", thus the chosen name for the operational "folds" (numeric values) that are involved in the computation of the Algebraic Field and Space operations.

By construction Euclidean Algebra is n-dimensional and n-plical, but this is not true for all Algebraic Spaces. For example, under a Projective Space that is n-dimensional the Algebra is (n + 1)-plical, which is why an (n-1)-dimensional Projective Geometry is used to model Geometric Optics in an n-dimensional Euclidean Geometry.

So, again, what is a blade?

In this example, a 1-blade (where k = 1) is equivalent to the common notion of a "vector".

Blades are actually quite similar to tensors, except that where the Tensor-Product is commutative, the Geometric-Product is anti-commutative. This makes it an order-preserving dyadic operator which allows for extra information to be embedded in the result of the operation. The benefit is essentially that it adds a binary "sign" to blades, such that -b and +b have the same "magnitude" but opposite "directionality". Blades represent the concept of "Directed Volumes" -- also known as "Directional Volumes".

A single "point" of volume is infinitesimally small, in its contents, but it still "exists". Essentially it is a number. So like how 1-blades are Vectors, 0-blades are Scalars (signed numerical values).

k, the grade or gradality, thus conveniently represents the number of elemental tuples required to define the blade. So for k = 0 over the Set of Real Values, there's 0 tuples, but we still need a real-value for the blade, thus the 0-blade is simply a Real Valued number, and its directionality is its binary sign (+/-).

For k = 1, we have a Vector, which is a tuple of Real Valued numbers, each number has a binary sign, and the overall vector itself has a directionality to it based on the values in the tuple. The length of that tuple is l, the plicality. The dimensionality of the Algebraic Space, n, is the maximum possible value for k, such that there are no blades in an Algebra that have a grade higher than n.

In our n = l = 3 Euclidean example, a k = 1 blade named a might be represented like: (a_x, a_y, a_z), where the magnitude of a, also known as the "Absolute Value" is: |a| = sqrt((a_x ** 2) + (a_y ** 2) + (a_z ** 2)), the square-root of the sum of the squares (the Euclidean "norm" or "distance-metric").

A k = 0 blade might be something like +7, positive-seven.

A k = 2 blade would be represented by two tuples, both of length l = 3, essentially creating a 3x2 or 2x3 "matrix", similar to how Tensors are often represented as a matrices.

A k = 3 blade is represented as three tuples, all of length l = 3, and the tuples essentially make-up the "vector" definitions of the axes of the k-dimensional local-volume that is the blade.

A 0 blade has no volume, it is a scalar. For k = 1, they have one axis, making them 1-dimensional, which means that the volume is the length, thus they are lines (line-segments).

When k = 2 there are two axes that are, by definition, orthogonal to one another, meaning that on the plane where they both lie the angle between them is 90-degrees (pi/2 or tau). If you took the inner product of the 1-blades that define any 2-blade, the result is always 0 -- there's zero amount of projection or "shared volume" between them. These orthogonal "axes" form the outline of half the planar volume defined by a 2-blade. The local-volume is itself a parallelogram.

If C is our 2-blade created from 1-blades a and b, then C = a ^ b (where ^ is the Wedge-Product, a.k.a. the Exterior-Product), such that the sides of C are a and b:

      b
    -----
   /    /
a /  C / a
 /    /
 -----
   b

As mentioned before -C = b ^ a:

      b
    -----
   /    /
a / -C / a
 /    /
 -----
   b

Identical, but with different "directionality".

If you're familiar with OpenGL or graphics programs, this comes-up a lot with "faces" of polytopes that are either facing "in" or "out", essentially the direction of the "normal" (vector) on the face determines if it will be drawn or lit with respect to the 3D Engine's camera for a scene, depending on how the light-source vectors are oriented with respect to the normal vector for each face.

A k = 3 blade will then be a parallelepiped (a 3D parallelogram), a polytope defined by the volume between three 1-blades, or (equivalently) by the volume of a 2-blade that is "swept"-along a 1-blade.

In fact, the "sweeping" concept may arguably be one of the best metaphorical explanations for how the Wedge-Product (Exterior Product) works.

Why is this useful?

The benefit of modelling mathematical constructs with blades is simultaneously conceptual and relational.

Conceptually, the blades can easily represent volumes of polytopes and spheroids of any dimensionality.

Relationally, blades unify scalars, lines, planes, and other higher-dimensional volumes into a common algebra with consistent formulas and relationships.

Since the blades are abstract mathematical constructs, they're not explicitly tied to any kind of data domain or representation. This means that they can be used for time-varying data, probability distribution functions, calculus, and mixed-domain data.

And given the Abstract Algebra construction, the plicality unifies Euclidean and Projective Geometry to use the same mathematical elements, without needing to create a lot of one-off exceptions and exemptions. Instead of defining mathematics by exceptions from Classical Linear Algebra, they can be unified in a well-defined Abstract Algebra.

Falling-out of all of this are lots of things like rotations, transformations, and intersections that are much easier to define and symbolically represent.

The difficulty is that the Inner Products (Contractions) and Exterior Product definitions are relatively more complicated to introduce. But again, the benefit is that the complexity of these operations simplify many of the other "downstream" operators.

References

Copyright

Copyright (c) 2020, Tommy P. Keane

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.