old_geometry

Geometry types and algorithms.

Special thanks to:

  • Tomasz Stachowiak (h3r3tic): allowed me to use parts of omg.
  • Jakob Øvrum (jA_cOp): improved the code a lot!
  • Florian Boesch (___doc__): helps me to understand opengl/complex maths better, see: http://codeflow.org/.
  • #D on freenode: answered general questions about D.

Note: All methods marked with pure are weakly pure since, they all access an instance member. All static methods are strongly pure.

TODO Support radian and degree types (from units-d package)

TODO Use sink as param in toMathML and toLaTeX

TODO Replace toMathML() with fmt argument %M to toString functions TODO Replace toLaTeX() with fmt argument %L to toString functions

TODO Optimize using core.simd or std.simd TODO Merge with analyticgeometry TODO Merge with https://github.com/CyberShadow/ae/blob/master/utils/geometry.d TODO Integrate with http://code.dlang.org/packages/blazed2 TODO logln, log.warn, log.error, log.info, log.debug TODO Make use of staticReduce etc when they become available in Phobos. TODO Go through all usages of real and use CommonType!(real, E) to make it work when E is a bignum. TODO ead and perhaps make use of http://stackoverflow.com/questions/3098242/fast-vector-struct-that-allows-i-and-xyz-operations-in-d?rq=1 TODO Tag member functions in t_geom.d as pure as is done https://github.com/D-Programming-Language/phobos/blob/master/std/bigint.d TODO Remove need to use [] in x[] == y[]

See: https://www.google.se/search?q=point+plus+vector See: http://mosra.cz/blog/article.php?a=22-introducing-magnum-a-multiplatform-2d-3d-graphics-engine

Members

Aliases

T
alias T = transpose
Undocumented in source.
dot
alias dot = dotProduct
Undocumented in source.
mat2
alias mat2 = Matrix!(float, 2, 2)
Undocumented in source.
mat2_cm
alias mat2_cm = Matrix!(float, 2, 2, Layout.columnMajor)
Undocumented in source.
mat2d
alias mat2d = Matrix!(real, 2, 2)
Undocumented in source.
mat2i
alias mat2i = Matrix!(int, 2, 2)
Undocumented in source.
mat2r
alias mat2r = Matrix!(real, 2, 2)
Undocumented in source.
mat3
alias mat3 = Matrix!(float, 3, 3)
Undocumented in source.
mat34
alias mat34 = Matrix!(float, 3, 4)
Undocumented in source.
mat4
alias mat4 = Matrix!(float, 4, 4)
Undocumented in source.
nvec2f
alias nvec2f = Vector!(float, 2, true)
Undocumented in source.
outer
alias outer = outerProduct
Undocumented in source.
vec2b
alias vec2b = Vector!(byte, 2, false)
Undocumented in source.
vec2d
alias vec2d = Vector!(float, 2, true)
Undocumented in source.
vec2f
alias vec2f = Vector!(float, 2, true)
Undocumented in source.
vec3f
alias vec3f = Vector!(float, 3, true)
Undocumented in source.

Enums

Layout
enum Layout
Undocumented in source.
isFixMatrix
eponymoustemplate isFixMatrix(E)
Undocumented in source.
isFixPoint
eponymoustemplate isFixPoint(E)
Undocumented in source.
isFixVector
eponymoustemplate isFixVector(E)
Undocumented in source.
isMatrix
eponymoustemplate isMatrix(E)
Undocumented in source.
isPlane
eponymoustemplate isPlane(E)
Undocumented in source.
isPoint
eponymoustemplate isPoint(E)
Undocumented in source.
isQuaternion
eponymoustemplate isQuaternion(E)
Undocumented in source.
isVector
eponymoustemplate isVector(E)
Undocumented in source.

Functions

crossProduct
auto crossProduct(T a, U b)
distance
real distance(T a, U b)
dotProduct
T dotProduct(T a, U b)
elementwiseLessThanOrEqual
auto elementwiseLessThanOrEqual(Vector!(Ta, D, normalizedFlag, orient) a, Vector!(Tb, D, normalizedFlag, orient) b)
Undocumented in source. Be warned that the author may not have intended to support it.
intersect
bool intersect(Circle!T circle, Rect!T rect)
makeInstanceAliases
string makeInstanceAliases(string templateName, string aliasName, uint minDimension, uint maxDimension, string[] elementTypes)
Undocumented in source.
outerProduct
auto outerProduct(Vector!(Ta, Da) a, Vector!(Tb, Db) b)
sphere
auto sphere(C center, R radius)
Undocumented in source. Be warned that the author may not have intended to support it.
spherePoint
auto spherePoint(Ts args)

Instantiator for SpherePoint3.

sqrtx
auto sqrtx(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
transpose
auto transpose(Vector!(E, D, normalizedFlag, orient) a)
Undocumented in source. Be warned that the author may not have intended to support it.
unite
Box!(E, D) unite(Box!(E, D) a, Box!(E, D) b)

Either an element in min or max is nan or min <= max.

unite
Box!(E, D) unite(Box!(E, D) a, Vector!(E, D) b)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Box
struct Box(E, uint D)

D-Dimensional Axis-Aligned (Hyper) Cartesian Box with Element (Component) Type E.

ForcedParticle
struct ForcedParticle(E, uint D, bool normalizedVelocityFlag = false)

D-Dimensional Particle with Coordinate Position and Direction/Velocity/Force Type (Precision) E. F = m*a; where F is force, m is mass, a is acceleration.

Matrix
struct Matrix(E, uint rows_, uint cols_, Layout layout = Layout.rowMajor)

Base template for all matrix-types.

Particle
struct Particle(E, uint D, bool normalizedVelocityFlag = false)

D-Dimensional Particle with Cartesian Coordinate position and velocity of Element (Component) Type E.

Plane
struct Plane(E, uint D)

D-Dimensional Infinite Cartesian (Hyper)-Plane with Element (Component) Type E.

Sphere
struct Sphere(E, uint D)

D-Dimensional Cartesian (Hyper)-Sphere with Element (Component) Type E.

SpherePoint3
struct SpherePoint3(E)

3-Dimensional Spherical Point with Coordinate Type (Precision) E.

Meta