class Vector

The basic element of geometry is a point or vector. We could use the PVector class of processing to work with vectors in 2 and 3-dimensional space. However, this is not really efficient for 2-dimensional vectors, because their z-component is simply put equal to zero and the calculations are done in 3-dimensional space. I wanted to have a more efficient class for vectors because image manipulation uses for each pixel a vector. Then, reducing data by one-third becomes important. Thus I made up a class called Vector, see the next post “class Vector – the code“.

Vector has approximately the same methods as PVector. You find them in the source code. I have added diagnostics that show the position of a vector or print its value.

In later posts you will see how iterative methods for tessellations can be easily programmed with the class “Vector”. But for the projection method and the dualization method we will need more, such as classes for lines and polygons.

This entry was posted in programming and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s