axelpale / affineplane

Affine 2D and 3D geometry library for JavaScript
https://axelpale.github.io/affineplane/
MIT License
7 stars 0 forks source link

Configurable interface #1

Closed axelpale closed 2 years ago

axelpale commented 3 years ago

The host applications might already deal with geometric objects that have properties like x and y or dx and dy. Should there be a way to adapt affineplane's interface to the object shapes and types instead of the host application adapting to the affineplane?

axelpale commented 2 years ago

Thoughts on implementation. Either every function takes in an interface configuration object, or alternatively and preferably, the library will be built from the configuration object. The config object defines the schema to use for vectors and matrices.

axelpale commented 2 years ago

This issue, although being an interesting feature, does not offer much for the current main purpose of affineplane. It also contradicts with the functional aspect of affineplane in the way that the functions cannot be used to modify existing objects but always returns new objects. Therefore, the benefit from allowing users to custom the object shape probably does not bring any efficiency if the resulting properties still need to be copied to another object in the host app.