What's a vector?

Discussion in 'Plugin Development' started by Daniel Heppner, Apr 8, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Daniel Heppner

    I'm aware of what a vector would be if it were an image, but I don't understand how one might use that when making a Bukkit plugin. I've seen something else where someone wanted to find all the players within a radius, but he used a vector to accomplish that. I know what I need to do to find all the players in a radius of another player (to light them on fire x]), but I'd have to use a vector, and I don't know what that would do or what it is. If someone could clarify what exactly a vector is and how else I might be able to use it, that'd be great.

    Thank You,
    Daniel.
     
  2. Offline

    Carnes

    Isn't a vector a point and direction? So x, y, z, angle?
     
  3. Offline

    willurd

    A vector is a mathematical 'object' that exists in (usually) 2d or 3d space and has both a magnitude and a direction. An example of a vector would be (0, 1, 2), where x = 0, y = 1, z = 2. This looks very much like a point in 3d space and in fact vectors are often used for that very purpose (though some languages/frameworks have a separate Point class). But vectors more complex than a point as they can be used to say in which direction an object is facing and how fast they are moving and can be added to or subtracted from other vectors (and more).
     
Thread Status:
Not open for further replies.

Share This Page