|
| 19 Mar 2014 08:03 AM |
Quote from the wiki: "The three values are an X coordinate, a Y coordinate, and a Z coordinate. When combined, these coordinates can represent a 3D point in space."
So, a Vector3 is a 3D point in space. Alright. Let's scroll down off the wiki page a bit and we see:
Vector3.x The x-coordinate Vector3.y The y-coordinate Vector3.z The z-coordinate Vector3.unit A normalized copy of the vector - one which has the same direction as the original but a magnitude of 1 Vector3.magnitude The length of the vector
Magnitude. Obviously said that it's the length of the vector. But as I learned, a point shouldn't have a length. Someone help me out here. |
|
|
| Report Abuse |
|
|
| 19 Mar 2014 08:25 AM |
magnitude is for exemple used to know the distance between two parts, like this: local distance = (brick1.Position - brick2.Position).magnitude |
|
|
| Report Abuse |
|
|
| 19 Mar 2014 08:39 AM |
I don't need an example. I need a definition. Magnitude is length. That's established. So, do we have to redefine Vector? What is a Vector3? That's what I need. |
|
|
| Report Abuse |
|
|
| 19 Mar 2014 08:43 AM |
| Vector 3 is just a 3d value of a single point, magnitude is used to get length between two vector3 points |
|
|
| Report Abuse |
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 19 Mar 2014 08:49 AM |
@HarrySnotte, that's an application, but that doesn't explain anything.
The OP states: [[So, a Vector3 is a 3D point in space. Alright. Let's scroll down off the wiki page a bit and we see:
Vector3.x The x-coordinate Vector3.y The y-coordinate Vector3.z The z-coordinate Vector3.unit A normalized copy of the vector - one which has the same direction as the original but a magnitude of 1 Vector3.magnitude The length of the vector]]
This is false. A Vector3 userdatum is not a 3-dimensional point in space. A vector is a mathematical entity that yields both magnitude and direction, whereas a scalar only has magnitude. For example, "5 miles per hour" is a scalar because it only has magnitude. Similarly, "5 miles per hour to the north" is a vector because it tells us both magnitude and direction. It is useful to treat vectors as points in Roblox because we don't have to fundamentally distinguish between location and direction; e.g., they are practical in objects like BodyVelocity but are still used in the Position property.
Vectors are usually written mathematically in vector notation, like: v = i + 2j + 3k or v = <1, 2, 3> The former is typically handled in physics, whereas the latter is common in pure mathematics. The unit of a vector is defined as: v dot = v/||v|| That is, every element in the vector is multiplied by 1/||v||, where ||v|| is the magnitude of the vector. Though, how do we find the magnitude of a vector? We take the sum of squares of all the components of the vector, then take the principal root. That is: ||v|| = sqrt(v1^2 + v2^2 + v3^2 + ... + vn^2) Note that this is defined for an n-dimensional vector, whereas we usually deal with 3-dimensional vectors. For our <1, 2, 3> example: sqrt(1^2 + 2^2 + 3^3) = sqrt(1 + 4 + 9) = sqrt(14)
So, you ask, what exactly is a Vector3 in Roblox? Well, it is still a vector. We can just treat it as a point, because it doesn't matter where a vector starts; in Roblox, nevertheless, we always force the Vector3's origin to be <0, 0, 0>. So if you imagine a ray drawn from a point <0, 0, 0> on a baseplate, then imagine it reaching out to any random point, that is a Vector3. Although, when we think of it in terms of the Position property, we only perceive the foreseeable endpoint (even though there is no true endpoint of a vector). |
|
|
| Report Abuse |
|
|
| 19 Mar 2014 08:52 AM |
| Alright. Thanks Absurdism. |
|
|
| Report Abuse |
|