Friday, January 23rd, 2009
Spatial Query: handling spatial maths with flair
<>p>Chris Zelenak has created Spacial Query a very nice library for spatial math. He told us:I recently wrote up a library to help me with operations on polygons, and ended up adding some stuff for dealing with matrix, vector and latitude longitude primitives as well. The name is taken from the JQuery style chaining in the library, that I added just because, well...I like JQuery, and I like being able to do things like:
JAVASCRIPT:
$ll([latitude, longitude]).vector().project_onto([wsg84x, wsg84y, wsg84z]).latlng()It adds a series of $ methods to the global namespace - $p for polygons, $v for vectors, $m for matrices and $ll for latitude/longitude coordinates.
Most vector and matrix operations support calculations to any dimension size.
In cases where they are not supported, one of the two following cases will arise:
- The function will be named
_2d or _3d to indicate what dimension the operated data should be in - The function will throw an error stating that the general case solution has not been implemented yet. (Matrix inversion, for example)
Related Content:











Also that things can be useful for PhoneGap… thank you for the news…
IMoogle developer Team.