The jt_vectors library is a procedure-rich object-oriented library which allows the definition and use of coordinates and vectors in 3D space. Creative applications of this allow for the foundations of 3D physics, and even rudimentary use of the library allows you to create seamless pixel-based games where objects are not constrained to the tile grid.
jt_vectors defines three object types:
/coordinate: A coordinate is a single point in 3D space consisting of an x-, y-, and z-coordinate. It can also refer to a point in 2D space (like a traditional BYOND game) just fine, since there's nothing that says you have to use a z-coordinate unless you really want to.
/vector: A vector is a special construct used to mathematically refer to a "quantity" associated with a "direction". A typical number (say, "30 km/h") is a "scalar" -- it is just a "quantity" that doesn't really say anything except how much you have (for instance, if I was going 30 km/h, I might never arrive at my destination if I'm driving the wrong way). A "vector" includes a direction; if I was going 30 km/h and travelling due north, I could plot that in terms of a vector on the planet's surface.
/jt_vectors: The jt_vectors library also defines a catch-all utility object which allows you to access some handy shorthand procedures for working with vectors and coordinates.
AngleAB(src_a, src_b, trg_a, trg_b)
arctan(x,y) //thanks to Lummox JR
* Initial release
* Added jt_vectors.AngleABWithin(angle, left, right)
* Added vector.AngleWithin(left, right)
* Added vector.BearingWithin(left, right)
* Added vector.AngleXYWithin(left, right)
* Added vector.AngleXZWithin(left, right)
* Added vector.AngleYZWithin(left, right)
* Fixed vector.RotateX(angle)
* Fixed vector.RotateY(angle)
* Fixed vector.RotateZ(angle)
* Fixed vector.RotateAngle(angle)
* Fixed vector.RotateBearing(bearing)
* Fixed glaring but extremely minor error in the utility procedure VectorFromBearing(bearing, magnitude, pitch) -- the proc was asking for the magnitude and pitch in the wrong order.
Jan 24 2007, 9:00 pm