Vectors and scalars

  • vectorThere’s direction and there’s magnitude
  • scalarThere is no direction only magnitude

This is useful for simulating various physical movements in canvas.

Uniformly accelerated motion

  • V = where v0 + atsThis formula gives the relationship between velocity and acceleration and time
  • S is equal to v0t plus at squared over 2, this formula gives the relationship between distance and acceleration and time. This formula is mainly used to calculate distance
  • v0^2-v1^2=2as, this formula gives the relationship between speed and acceleration and distance, mainly in the case of not knowing the time, find the speed

Description: V: speed; V0: initial velocity; V1: final velocity; A: Acceleration; T: time; S: distance

Canvas simulation: uniformly accelerated horizontal straight line motion, free fall motion, vertical upthrow, flat throw motion (uniformly variable curve motion)…

Centripetal acceleration

  • Linear velocityV = s/t = 2 PI r/ t
  • The angular velocityω = φ /t = 2π/ t = 2πf ω×r=V
  • Centripetal accelerationA = V2/r = ω2r = (2π/T)2r
  • Period and frequency:T = 1 / f
  • The relation between angular velocity and linear velocity:V = omega r
  • The relationship between angular velocity and rotational speedOmega = 2 PI n(Frequency and speed have the same meaning here)

Arc length (s); Meters (m); The Angle (Φ); Radians; Frequency (f) : Hertz (Hz); Period (T) : second (s); Speed (n) r/s; Radius (r): m (m); Linear velocity (V) : m/s; Angular velocity (ω) : rad/s; Centripetal acceleration: m/s2

Canvas simulation: uniform circular motion, pendulum clock motion…

force

  • Gravity G=mg vertically downward G= 9.8m /s2 ≈10 m/s2 At the center of gravity applied near the earth’s surface, f = Ma, force, mass, acceleration relationship, assuming that the mass m is 1 then F = a;

  • Hooke’s Law F=kX direction along the direction of recovery deformation K: stiffness coefficient (N/m) X: shape variable (m)

  • Sliding friction f=μN opposite to the relative motion of the object μ : friction coefficient N: positive pressure (N)

  • Static friction force 0≤ F ≤ FM FM is the maximum static friction force

  • Gravity F=G m_1m_2 / R2 G=6.67×10-11 N·m2/kg2 direction on their line

Canvas simulation: elastic motion, frictional deceleration motion…

Solving algebraic equations

  • Add any real number to both sides of this equation.
  • Subtract any real number from both sides of this equation.
  • Multiply both sides of this equation by any real number.
  • Let’s divide both sides of this equation by any real number.
  • Multiply or divide one or both sides of the equation by or by 1

Trigonometric functions

All apis related to angles in canvas use radian to specify the Angle value, and apis related to trigonometry functions in JavaScript also use radian, such as math.sin (), math.cos () and math.tan2 ()

  • C = 2 PI r
  • 360 degrees = 2 PI radians; PI radians = 180 degrees; 1 radian = (180/p) × degree; 1 degree is p over 180 times radians
  • Pythagorean theorem: The hypotenuse of any right triangle is equal to the square root of the sum of squares of the other two sides

But one thing to mention is that Canvas uses the W3C coordinate system. The W3C coordinate system is different from the mathematical coordinate system in that the mathematical coordinate system has the positive y-direction up, while the W3C coordinate system has the positive y-direction down. So you have to be careful when you represent angles

Canvas simulation: clock, follow mouse movement…

The above is about some junior and senior high school knowledge needed to do some simple physical movements with canvas