Math

Linera Algebra MIT course https://www.quantamagazine.org/the-map-of-mathematics-20200213/
https://mlu-explain.github.io/

Notation

Math is implicit, therefore hard to read sometimes programing is explicit, we can can name values…

    Order of operations
1 (), [], {} Parentheses, Brackets, Braces
2 x^a , √ Exponents, radicals
3 x, / Multiplication, Division - from left to right
4 +, - Addition, Subtraction - from left to right
  value  
0.000 000 256 2.56x10^-7 1.64e-07
0.000 2 2x10^-4 2e-04
0.2 2×10^−1 2e-1
1 1×10^0 Scientific notation
1.6180 φ (phi) a+b/a Golden ration from Fibonacci seq
2.71828 e unique number whose natural logarithm is equal to one
3.141592 π (pi)  
4.669 δ Feigenbaum Constant ratios in a bifurcation diagram for a non-linear map.
10 1×10^1 1e+1 - order of magnitude
100 1×10^2 1e+2 - two orders of magnitude
137.5   Golden Angle (Flower Distribution)
200 2×10^2 1e+2

https://bivector.net/ - Vectors
https://eater.net/quaternions - Quaternions
http://immersivemath.com/ila/index.html - immersive math
https://www.desmos.com/calculator - function plot


Linear Algebra

Algebra: where symbols repleace numbers. Flat no bending cureves projective geometry - points lines and planes, concept of duality (rotation is translation with pivot in infinity)

properties of vector spaces and matrices study of straight lines involving linear equations.

Functions

  • Addition - is like offset (subtraction is addin negative number (special case of adding )> a-b = a+(-b))
  • Multiplication - is like scale (dividing is special case of multiplaing a/b = a*(1/b))

Lerp

https://youtu.be/YJB1QnEmlTs

  • Lerp : ov = Lerp(oMin, oMax, t)
  • Inverse Lerp : t = InvLerp(iMin, iMax, value)
  • Remap ov = Remap(iMin, iMax, oMin, oMax, value)

Eerp

  • Reminder that you should use exponential interpolation, not linear, for multiplicative quantities~
  • if you want to find the frequency, zoom level or scale, halfway between 2 and 8, then the right answer is 4, not 5
    • lerp( 2, 8, 0.5 ) = 5
    • eerp( 2, 8, 0.5 ) = 4
    • lerp(a,b,t) = a(1-t) + bt
    • eerp(a,b,t) = a ^(1-t) bt

Slerp

  • Quaternion lerp for rotation

Vectors

  • Sign sign(x) - Direction : unit vector: on 1 dim is one or minus one
  • signed distance, can be nagetive (signed area, signed distance fields)
  • Lenrh len(x) = abs(x) = Length/Magnitude

Equations

Operation     -  
a+b a+b - move b to tip of a. Vector    
a-b a-b = a+(-b) Vector    
Dual Vector    
Dot product a°b Scalar -1 - 1 1 = similar, 0 = perpendicular - orthogonal (90°), -1 = opposite dir (180°)  
Cross product AxB Normal vector Normal of plane created by 2 vec len depend on angle n (only in 3 dimentions)  
Wedge product 2 vect A^B Bivector plane with orientation witch contain a and b. (magnitude and orient) Exterior product > (similar to cross)
Wedge product 3 vect A^B^C Trivector Extruded bivector if vect are linearly dependent wedge = 0 ()  
Contraction product a╜x = B, a╜b = a*b   dot in higher dimenmtion (how similar)  
Geometric product ab = a╜b - a^b, aB = a╜B + a^B Real + Bivector complex number inner(dot) + outer product(wedge,’cross’) (plane) -  
Sandwitch product axa^-1 Vector Reflection  
Rotor     is rotattion by double reflection (quaternion: vector i scalar quaternion is vector len rotor )  
Quaternion   Vector4    

Quaternions, Dual quaternions, Exterior Algebra

Matrices

Tensor - is like vector written by components made of dot products of component vectors

Transform matrix

Storing data for transformation (no scale):

xx yx zx posx xy yy zy posy xz yz zz posz
0 0 0 1

  • scale & orientation is in 3x3 matrix
  • scale is stored in length of 3 vectors.
  • can multiplay matrix by vector to get vector & transform coordinate space

  • xyzw (if w=1 trans point if w=0 is vector so only local vector not taking pos in account)

Identity matrix (in word space orientation, when multiplying give same resoult) 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 - extra row for non equidial


Trigonometry

unit circle. - radious of 1

Angles

degrees 0-360° - measure angles by how far we tilted our heads- observer viewpoint radians 2πr ~6.283.. - measure angles by distance traveled - movers viewpoint - easier to doing a math in formula. some variables will work out nicley.

VEX ORIENT pxl.ink

revolution rev 0-1 - 1 full circle = 1 rev = 1 turn = 1 rot = 360°

euler angle direction 3Vector
dihedral angle - is the upward angle from horizontal of the wings or tail plane of a fixed-wing air craft.

matrix3 m = i

Rotation / orientation

Link to Houdini vex site

Rotate vec by angle

a = angle
a > (cosa, sina) b > (-sina, cosa) v’ = vxa + vyb

in rotation vector matrix v’ = [cosa, - sina] [sina, cosa ]

https://youtu.be/7j5yW5QDC2U

transform from local space of a to world space


Curves

Bezier

https://youtu.be/aVwxzDHniEw

  • Cubic bezier - bezier on bezier

Calculus

Mathematic of change, more abstract, (smoothly changing things involving derivatives, integrals, vectors, matrices, and parametric curves) but using algebra to calculate. (newton, leibnitz).

Differential equations

Differentiation (różniczka): derivative of a fn. > Instantaneous rate of change Integration (całka): Integral of a fn. > Area under its graph

Derivative

pochodna

Integral

całka

fn

Fourier

Fourier Transform: decomposing to freq. . represents sampled signal as sin and cos Fast Fourier Transform: recognizing symmetry

Laplace

Tel us both if sinusoids and exponentials are represented in the function

divergence of the gradient of some function. so say you have a heightfield (like a 2d grid with a scalar quantity on that grid, defining height).

the laplacian of the height value at any given voxel, will be a scalar value that basically tells you what the rate of change in that voxel will be, if you flow along the height fields gradient.

when you’re doing this on a volume grid there’s a “discrete laplacian operator” that’s basically just a kernel that approximates the real thing

so if u want to sort of guide the growth, you would want to basically define a divergence field (diverg of field ‘+’ when go awa -“ when go to this point , )to mix in or merge on top (similar to how u would guide a smoke/flip sim). basically you would want to find the directions you want to flow towards, compute the divergence of that, and then add that on top of your laplace values. but id have to know how the growth is being driven, to confirm if that would work

If you want it to get more interesting rather than your growth weight being just the laplacian you can do something like growthweight = laplacian * dot(volumegradient, vec) where vec comes out of some 3d noise or something

Monte-Carlo

random statistical model with random and proportions to calculate values by takeing random samples. (ie area )

Gerstner Waves


.md Latex notation

\( \sqrt{\frac{n!}{k!(n-k)!}} \) or this one \( x^2 + y^2 = r^2 \).

\[a*b\] \[axxb\] \[u^^v\] \[a^2 + b^2 = c^2\] \[\mathsf{Data = PCs} \times \mathsf{Loadings}\] \[sum_(i=1)^n i^3=((n(n+1))/2)^2\]

gravity > jerk is the ratoe of change in acceleration > accel (d²x/dt²) is the rate of velocity change > velo (v=dx/dt)is the rate of change of > position derivat and integrals of eachother

velocity

\[v=ds/dt\]

acceleration

\[a=dv/dt\]

integrate gravity over time to get velocity > integrate again to get position

LOGa ^b - do jakiej potęgi należy podnieść liczbe z postawy log zeby otrzymac liczbe logarytmowanąą a^n = b <=> loga ^b Log naturalny


====== 1D nonlinear transf (normalized utility fn) https://youtu.be/mr5xkf6zSzk https://youtu.be/Fy0aCDmgnxg https://www.youtube.com/watch?v=AJdEqssNZ-U

easing - smoothstep -

implicit equations vs parametric equations

  • implicit
  • parametric (fn) like sin

  • 0-1 - % - Normalized
  • -1-1 - noise distribution variation
  • linear speed p=(t)
  • square p=(t*t) (in range 0-1) reduce value
  • square have odd and even fn
  • easing filter tweening fn (same)
out RangeMapin,inSttart,inEnd, outStart, outEnd(
  {
    out = in-inStart; // Puts in [0,inEnd=inStart]
    out /= (inEnd=inStart);
    out = ApplySomeEasingFn(out); // in [0,1]
    out *= (outEnd-outStart); // Puts in [0, outRange]
    return out + outStart; // Puts in [outStart,outEnd]
  }

square is expensive !

Pow

  • is troche expensive 10x faster: ``` FakePow(x,2.2)= (.8x^2) + (.2x^3) FakePow(x,2.6)= (.4x^2) + (.6x^3)

smoothstart

x = t*t //quadratic x = t^3 // cubic x = t^4 // quartic x = t^5 // quintic

Smooth Stop
- deceleration
- flip square filp  

x = 1-(1-x)^2 // small jerk almost linear x = 1-(1-x)^3 // fast stop

Can mix

x = mix( SmStrt2, SmStrt2, 0.2); // 2.2 x = mix( SmStrt2, SmStrt2, 0.6); // 2.6

```

mainfolds:

  • cartisioan (kratka)
  • polar (r i kąt) na tej samej przestrzeni mozesz namalowac

    https://mlu-explain.github.io/