I doing programming but I am not good at math.
I want to represent point and vector in different type. Both point and vector are tuple of 3 elements, where point represent location and vector represent direction and magnitude.
Given P for point, V for vector and S for one dimensional scalar type, how they interact each other in arithmetic operations?
By arithmetic operations I mean addition, subtraction, multiplication dan division.
In my understanding, adding or subtract 2 vectors will get result as vector.
V + V = V
V - V = V
but, what about addition or subtraction vector with scalar? is that make sense?
Multiplication vector with scalar have meaning to scale the magnitude of vector, which is give vector as result.
V * S = V
Subtraction of 2 points will result a vector between two points
P - P = V
well, that is what I know, I not sure about the other operators.
So, my question is, what is the result type of arithmetic operations of vectors, points and scalars?
V + V = V V + S = ? V + P = ?
V - V = V V - S = ? V - P = ?
V * V = ? V * S = V V * P = ?
V / V = ? V / S = V V / P = ?
P + V = ? P + S = ? P + P = ?
P - V = ? P - S = ? P - P = V
P * V = ? P * S = ? P * P = ?
P / V = ? P / S = ? P / P = ?
S + V = ? S + S = ? S + P = ?
S - V = ? S - S = ? S - P = ?
S * V = V S * S = ? S * P = ?
S / V = V S / S = ? S / P = ?
P: point
V: vector
S: scalar
X: meaningless/not make sense