Skip to content

codetomatot/vps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 

Repository files navigation

C malloc be like: image

pi sources (not 40 digits that is acutally bad): https://www.jpl.nasa.gov/edu/news/2016/3/16/how-many-decimals-of-pi-do-we-really-need/

https://math.libretexts.org/Bookshelves/Applied_Mathematics/Mathematics_for_Game_Developers_(Burzynski)/04%3A_Matrices/4.04%3A_Rotation_Matrices_in_2-Dimensions

once more trying to fix the rotations: image

Math proofs and derivations here:

angle between absolute x-axis and any vector

$$\vec{v_1} = \begin{bmatrix} x \\ y \end{bmatrix} \\\ \vec{v_2} = \begin{bmatrix} x \\ 0 \end{bmatrix} \\\ \cos(\phi) = \frac{\vec{v_1} \cdot \vec{v_2}}{\| \vec{v_1} \| \| \vec{v_2} \|} \\\ \implies \cos(\phi) = \frac{x^2}{\sqrt{x^2 + y^2}\sqrt{x^2}} \implies \phi = \arccos \left(\frac{x}{\sqrt{x^2+y^2}} \right)$$

the rotational matrix: say we have a normal 2d coordinate system,and some arbitrary vector A

$$A_x = A\cos(\theta) A_y = A\sin(\theta)$$

after a rotation of phi radians of the entire coordinate system:

$$A_x' = A\cos(\theta - \phi) = A\cos(\theta)\cos(\phi) + A\sin(\theta)\sin(\phi) = A_x\cos(\phi) + A_y\sin(\phi) A_y' = A\sin(\theta - \phi) = A\sin(\theta)\cos(\phi) - A\cos(\theta)\sin(\phi) = A_y\cos(\phi) - A_x\sin(\phi)$$

therefore in matrix:

$$\begin{bmatrix} A_x' \\ A_y' \end{bmatrix} = \begin{bmatrix} \cos(\phi) & \sin(\phi) \\\ -\sin(\phi) & \cos(\phi) \end{bmatrix} \begin{bmatrix} A_x \\ A_y \end{bmatrix}$$

image

using cross product to determine clockwise or counterclockwise rotations e.g negative cross product is clockwise whereas positive is counterclockwise

$$\det\left| \begin{bmatrix} \hat{i} & \hat{j} & \hat{k} \\\ x & y & 0 \\\ 1 & 0 & 0 \end{bmatrix} \right| \implies -y$$

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages