liveBook · Manning

Triangle

As explained in Math for Web Design

A triangle is a polygon with three sides and three vertices.

A triangle is a polygon with three sides and three vertices. In frontend work, triangles provide the geometric foundation for relating angles to direction, slope, and position, especially through right-angled triangles. section 9.1.1 section 1.4.7

Use a right triangle to connect an angle θ with its side ratios:

  • Sine measures verticalness: sin(θ) = opposite / hypotenuse. section 9.1.1
  • Cosine measures horizontalness: cos(θ) = adjacent / hypotenuse. section 9.1.1
  • Tangent measures steepness: tan(θ) = opposite / adjacent = sin(θ) / cos(θ). section 9.1.1
  • Apply these relationships to rotations, circular layouts, arcs, paths, and movement directions in CSS or JavaScript. section 1.4.7 section 9.0

A 45-degree direction

For a point on the unit circle at 45°, cos(θ) ≈ 0.707, sin(θ) ≈ 0.707, and tan(θ) = 1. The equal sine and cosine values indicate equal horizontal and vertical components; the tangent value indicates a slope of one. section 9.1.1

How Math for Web Design covers it

How deep it goes
Explains right-triangle side ratios, unit-circle coordinates, radians, and repeating function behavior without developing advanced geometry.
Examples
Uses a right-triangle diagram, unit-circle values, mouse coordinates, canvas lines, CSS rotation, and curved frontend animations.
What it assumes
Assumes basic frontend context while introducing angles, degrees, radians, points, lines, distances, and right-triangle terminology.
What you can do after
Apply triangle relationships to calculate horizontal and vertical components, slopes, positions, rotations, and movement directions.
How it connects
Connects triangles with trigonometry, angles, sine, cosine, tangent, unit circles, geometry, rotations, and paths.

Also explained in

Compare how 2 books explain triangle →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math for Web Design. The section links point to the parts of the book it draws on.