Cosine function
The cosine function is a periodic trigonometric function that maps a real number or angle to a value between −1 and 1.
Math for Web Design
cos() is a CSS mathematical function that returns the cosine of an angle.
- How it is used
- Positions horizontal circle coordinates and drives repeating frontend motion effects.
- How deep it goes
- Defines cosine through right triangles and unit circles, then works through CSS and JavaScript layout and animation uses.
- Examples
- Demonstrates a six-item circular menu and a swinging pendulum element.
- What you can do after
- Apply it via CSS cos() or Math.cos() to calculate horizontal circular positions and oscillating values.
Julia as a Second Language
cos is a Julia function that computes the cosine of an angle or numeric value.
- How it is used
- Uses cosine to turn measured angles into values for navigation and other triangle-based calculations.
- How deep it goes
- Explains cosine through navigation, then implements unit-aware methods and conversions without developing a cosine approximation.
- Examples
- Uses lighthouse navigation, sextant angle measurement, Radian and DMS types, and unit-aware cos calls.
- What you can do after
- Apply it via Julia’s cos methods to calculate values while making radians or degrees explicit.
Read how Julia as a Second Language explains cosine function →
D3.js in Action, Third Edition
Cosine is a trigonometric function that gives the ratio of the adjacent side to the hypotenuse in a right triangle.
- How it is used
- Positions vertical coordinates for radial SVG axes in a month-based visualization.
- How deep it goes
- Defines the right-triangle ratio and works through coordinate equations, without developing broader trigonometric theory.
- Examples
- Uses a circle with twelve month axes, angle calculations, and SVG line endpoints as concrete artifacts.
- What you can do after
- Build radial SVG axes by converting angles and radii into vertical endpoint coordinates.
Read how D3.js in Action, Third Edition explains cosine function →
Related concepts
- rotationused by · A rotation is a geometric transformation that turns points or objects about a fixed center, origin, or axis through an angle while preserving distances and angles.
- positional embeddingused by · A positional embedding is a learned or fixed representation that encodes an element’s position or order in a sequence and is incorporated into its content representation.
- trigonometrykind of · Trigonometry is the branch of mathematics studying relationships among angles, lengths, geometric ratios, coordinates, and periodic functions.
- type-generic macroalternative to · A type-generic macro is a macro-based interface whose expansion selects or adapts operations according to the types of its arguments or associated objects.
- operatorkind of · An operator is a symbol, keyword, or language construct that specifies an operation on one or more operands.
- sine functionproduced by · The sine function is a periodic trigonometric function that maps a real number or angle to a value between −1 and 1.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


