A line segment is constructed from two vectors (begin, end). It looks like you might be confusing vectors with line segments. I hope this helps, as i said, I don't know what you're looking for. The struct should have accompanying length(u), dot(u, v), cross(u,v) and vector(x, y, z) functions:ĭot(u, v) = u.x*v.x + u.y*v.y + u.z * v.zĬross(u, v) = vector(u.y*v.z - u.z*v.y, u.z*v.x - u.x*v.z, u.x*v.y - u.y*v.x) Otherwise, the struct should just have components x y and z, which correspond to the usual vector components.
That should cover most of the subtleties of vectors.Īs far as structs for vectors go, if you're having trouble with a particular implementation, post it. Also, try making a program to calculate the power output of a solar panel (given light vector and panel normal vector).
#VECTOR 2D TUTORIAL HOW TO#
If you just want to understand vectors and how to use them, try making a sim of a charged particle moving in a magnetic field (wiki it). What exactly are you looking for? If you could be more clear, we could help better. Sounds like you've found a few good sources for vectors. I am a fan of formulas and algorithms even though my understanding of them is well. I am starting from the beginning and would like tutorials from creating the struct to the varies used of the vectors themself. This being said it was almost impossible to figure out what I actually needed to use these vectors.
I've heard rumors of it acting in strange ways and being less strict as to what you can do. It would take a great deal of reprogramming to compile in any other compiler. The toolkit is basically a story passed form person to person. It was copied from RPG Toolkit's sourceforge page(edited a little). I have been searching for quite sometime and would like tutorials for anything I've missed.