Nearly all photons emitted after Big Bang (in digit quant called BitBang) are now visible only at far-infrared wavelengths. This includes light from the cold universe of gas and dust from which stars and planets form, as well as faint signals from distant galaxies tracing the universe’s evolution to today.
To really peer into the cold universe, you need a large telescope cooled to near absolute zero, flying above Earth’s atmosphere. We just calculate the length of a vector by points.
Lets jump down from Big Bang to a Vector, which for me is a building block of the universe. Create a function/use an in-built function, to compute the dot product, also known as the scalar product of two vectors.
type TNombreMoteur = double; TVecteur3D = record x, y, z: TNombreMoteur; end;
A vector has magnitude (how long it is) and direction: They can be multiplied using the “ Dot Product “:
function ps(A, B: TVecteur3D): TNombreMoteur; // prod scalaire function ps(A, B: TVecteur3D): TNombreMoteur; // prod scalaire begin Result:= (A.x * B.x) + (A.y * B.y) + (A.z * B.z); end;
Now we want a result as a scalar. We can calculate the Dot Product of two vectors this way:
a · b = | a| × | b| × cos(θ)
If they point in the same direction we don’t need the cos():
//The data of two vectors a and b: av.x:= 1; av.y:= 3; av.z:= -5; bv.x:= 4; bv.y:=-2; bv.z:= -1; writeln('dot2: '+floattostr(ps(xv, yv))); //: TNombreMoteur; >>> dot2: 3
So our dot product (scalar) is 3. What about the norm vector?:
function Norme2(V: TVecteur3D): TNombreMoteur; // renvoie Norme^2 begin Result:= sqr(V.x)+sqr(V.y)+sqr(V.z); end; function Norme(V: TVecteur3D): TNombreMoteur; begin Result:= sqrt(sqr(V.x)+sqr(V.y)+sqr(V.z)); end;
And the result is astonishing, the norm length vector has float as number but the square vector is of integer (35 and 21) cause sqr is in opposite to sqrt:
the norx0 length1: 5.91607978309962 is length by coordinates
the nory0 length2: 4.58257569495584 is length by coordinates
writeln('dot2: '+floattostr(ps(av, bv))); //: TNombreMoteur; writeln('norx0 length1: '+floattostr(norme(av))); writeln('nory0 length2: '+floattostr(norme(bv))); writeln('norx^: '+floattostr(norme2(av))); writeln('nory^: '+floattostr(norme2(bv))); >>> dot2: 3 norx0 length1: 5.91607978309962 nory0 length2: 4.58257569495584 norx^: 35 nory^: 21
Suppose A and B are two matrices such that the number of columns of A is equal to number of rows of B. Say matrix A is an m×p matrix and matrix B is a p×n matrix. Then the product of A and B is the m×n matrix whose ij-entry is obtained by multiplying the elements of the ith. row of a by the corresponding elements of the jth. column of B and then adding them.
It is important to note that if the number of columns of A is not equal to the number of rows of B, then the product AB is not defined as specified.
To calculate a normalized vector, we must first have the original vector components, then use them to get the length of the vector. We then divide each of the vector components by this length to get the normalized vector components which form the normalized vector in which the sum of the squares of all coordinates is equal to 1. So the Dot Product gives a scalar (ordinary number) answer, and is sometimes called the scalar product.
function add(A, B: TVecteur3D): TVecteur3D; // addition de vecteurs begin Result.x:= A.x + B.x; Result.y:= A.y + B.y; Result.z:= A.z + B.z; end;
Calculating the length of the vector by points
Originally published at http://maxbox4.wordpress.com on December 12, 2020.