Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Instantiation

Hamolicious edited this page Apr 21, 2021 · 2 revisions

I tried to keep the instantiation and usage as free and unrestricting as possible, for this reason, whenever you see a method taking *args any of the following is a valid value. The examples only show 2D vector instantiation but 3D is the same (just extend the dimension by 1):

>>> Vec2d()
vector X: 0, Y: 0

>>> Vec2d.zero()
vector X: 0, Y: 0

>>> Vec2d(1)
vector X: 1, Y: 1

>>> Vec2d(5, 2)
vector X: 5, Y: 2

>>> Vec2d([5, 2])
vector X: 5, Y: 2

>>> v = Vec2d(1, 2)
>>> Vec2d(v)
vector X: 1, Y: 2

Clone this wiki locally