Hi.

This is a website about anything.

Pick a button.

MATHS

Distances in space

Statistics with ranges

Calculus

Vector products

Squares and their roots

ART

Cycling

Trees

Map

ABOUT

                    Hi!

                    I made this website for fun (for profiles and such actually), and it's been rather fun so I am continuing it.

                    ntt.bacninh.vn
                        |
                        + The introduction with the picture I drew in February 2025.
                        |
                        + The navigation section where there will be buttons to different parts, but scroll if you like.
                        |
                        + MATHS, mostly explaining formulae, nothing much.
                        |
                        + ART, I put my works here. Most are digital because it is easier to put them here.
                        |
                        + ABOUT: Hi!
                        |
                        + SETTINGS: Yes, settings.

                    That's pretty much it, settings below, great to have this thing going like a real website.
                

SETTINGS





Distances in space




Calculate distances with vectors.




Usually the convenient way to calculate distances between a point and a line on a 2-dimensional plane involves applying coordinates of that point to the function defining that line. This step essentially projects the point onto the line, with the line of projection being parallel with the y axis. From there, we would divide the value by the length of the vector parallel to the line formed by the rise and the run of the line.



Oh and before anything it has to be noted that a line essentially divides a plane into 2 parts, one with points which yield a positive value when plugged into the function for the line, and another with points that do the opposite - that is yielding a negative value.



However, from this step it is easy to miss the whole idea of this division: we are not dividing the projection by the vector length. What we are doing is taking the reciprocal of the hypotenuse, which gives the sine of the angle between the line and the vertical projection. After that we would multiply the sine with the length of the projection, and the product would be the length of the perpendicular projection from the point to the line - the distance!



From there let's move on to 3-dimensional space: points, lines, and planes.



A plane in 3-dimensional space plays the same role as a line in 2-dimensional space, so reasoning is the same.



But from points to lines takes a bit of thinking. We know this formula:




                            | cross (v1 ; v2) |
                    d = ----------------------------
                                    |v1|
        


What we are doing here is essentially just taking the length of the cross product of the parallel vector (v1) of the line with the vector from the point to an arbitrary point along the line (v2). The length is |v1||v2|sin(v1;v2), and when we divide by |v1|, we have |v2|sin(v1;v2), which is the projection of the vector v2 onto a line perpendicular to the line in question. That is the distance from the point to the line.



There is also a way to measure line-to-line:




                            |dot (cross (v1, v2), v3)| 
                    d = ----------------------------------
                                |cross (v1, v2)|
        


What this formula does is taking the vector perpendicular to both lines - by taking the cross product of the parallel vectors 0v1 and v2. Dot product with v3 - the vector formed by two arbitrary points each on one of the two lines - basically projects the vector v3 onto the cross product. As dot product results in an area; to obtain a length, we have to divide by the product again. What remains is our desired result for the distance!




CLOSE






So you are given a formula for any Q in a frequency table with intervals:




                        n/q * N - P
                A + --------------------- * (B - A).
                            F
        


Here we have interval (A ; B), N is the total number of samples, n is the index of the Q, q is the total number of Q's, F is the frequency of the group wherein exists the Q of index q needed, and P is the frequency of the groups preceding the group in question.




What the formula tries to do is essentially to locate how far Q is from A and B, and find that value that fits Q.




So basically we can do these:


  1. We count in integers, so that's something to note.


  2. What we do first is take n/q to identify how far in we are in the sample list. The standard is to take the value with the index n/q, and in case where n is not divisible by q, an average is taken between 2 possible values.


  3. Then we subtract progressively the number n/q by each group's frequency until we go below 0, in which case the last group whose frequency can still be the subtractor is the one we want.


  4. After all the subtraction, we will be left with an index, which is the distance from A. We divide that by the length of the interval to see how far we are between A and B.


  5. The last thing to do is pretty straight forward: adding that to A to get the value of Q index q.



One more thing: we can have as many Q's as we want, and this will still work.




CLOSE






        



CLOSE



Vector products




Or the better way to think about them, at least for me.




As we know the dot product is how many times the projection of one vector onto the other goes into the other. It is reasonable for the presence of cosine of the angle between two vectors. But how do we represent the "times" geometrically? - Maybe we never had to. What we are doing is essentially calculating the area of the rectangle where one of the sides is the projection, and the other is the vector being projected onto. This gives an area, which does not seem very useful, but again, that's how standards work.




Just imagine, okay?


Besides the dot product, we have the cross product. We know it gives a vector perpendicular to both vectors whose length is the area of the parallelogram formed by the two. This way is the essence, but represented geometrically, it is just calculating the areas of the parallelograms formed by projecting the two vectors onto planes - Oxy, Oxz, and Oyz. The order by which the vectors appear will determine whether the area is positive or negative. The coordinates of the result vector will depend on those areas, and once we map them out, we are guaranteed to get the result vector just like the conventional way.




Keep imagining.


CLOSE



SQUARES AND ROOTS




And the not-very-convenient way to calculate them.




Let's think about squares like stacking squares of area 1. We know that to get the square of 2, we put 4 squares; for 3 we put 9, and so on. What we are essentially doing is adding one column and one more row, along with one square of 1 to complete the new bigger square, which means what we add to the old square would be twice the number of squares per side added with one more.



Before we continue though it has to be known this formula only works for integers.



The number of squares per side now becomes a sequence, with u[1] being 0, and u[n] being 2 * u[n-1] + 1. If we map them all out we are going to see that the array of differences between consecutive squares form an array of odd numbers from 1 to infinity. Using this idea we can create a formula for squares that uses only addition:




                    #Python code here.
                    n = int(input('Input your number: '))
                    result = 0
                    for k in range(0, n, 1):
                        result += k + k + 1
                    print('The square is: ',result)
        



In reverse, we can also calculate square roots this way.




                    #Python, again.
                    n = abs(int(input('Input your number (we will take the absolute value): ')))
                    remainder = n
                    k = 1
                    result = 0
                    while (remainder > 0):
                        remainder -= k
                        result += 1
                        k += 2
                    print('The square root is: ',result)
                    print('Remainder: ',remainder)
        



There we have them! Squares and square roots only with addition and subtraction.




CLOSE



A sketch about how fun cycling feels. It's a little whimsical, but there we go.








Not displayed


CLOSE



This is a little sketch of trees out in open field, basically following the styles of album covers and such.








Not displayed.


CLOSE



This is a little project where I travelled the city just to map it back. It was not that easy to do, but here it is, mostly complete though with some missing areas. I mostly travelled on main roads, so little lanes and spurs are not in here, and I don't think they have to be. I thought this would be really useful for friends who have never been to the city to navigate, but well they had their digital maps and this one never came to use. So here it is, displayed here, without being used for any sort of reference.








Not displayed.


CLOSE