A simple 3D vector library#
v3d
is a simple vector library with the common operations.
Usage#
If you have Open Dylan 2022.1 or later, the program
dylan is already installed as part of that release. Create
your new project with dylan new application <name>
, and edit the file
dylan-package.json
created. Just add v3d
in dependencies
.
To know more about dylan package manager visit Dylan tool.
Quick summary of v3d
#
The module v3d
exports the following features:
<v3>
andv3
to create instances.Query dimensions:
v-x
,v-y
,v-z
.Infix operations:
+
,-
,*
,/
,negative
,*
(scalar multiplication), and=
.Other operations:
squared
,magnitude
,cross-product
,normalize
anddistance
.Queries:
unit?
andzero?
Utility:
$v3-zero
andsimilar
.
See a detailed explanation with examples in the The v3d library link.
Note
The vectors are read-only. You can’t change the dimensions without creating a new instance. There are only getters methods and no setters.
Library structure and dependencies#
The libraries used by the project are shown with the modules inside. The arrows between the libraries are the dependencies.