A point is one exact location. In browser work, represent it with an x coordinate for horizontal position and a y coordinate for vertical position. The viewport or a container commonly supplies the origin: (0, 0) is its top-left corner, x increases rightward, and y increases downward. Thus (100, 150) sits 100px right and 150px below that origin. section 1.4.7 section 10.1
Points make pointer input and element geometry concrete. MouseEvent.clientX and clientY identify the pointer relative to the viewport. On a canvas, two points can define a line: moveTo() sets the start point and lineTo() sets the end point. Absolute positioning and transforms can likewise depend on precise coordinate locations. section 1.4.7 section 10.1
Use points as the fixed locations behind common interface calculations:
- Record a drawing cursor as an (x, y) point, then extend the current canvas path to that location. section 1.4.7
- Find an element center from its bounding rectangle: left + width / 2 and top + height / 2. section 10.2.3
- Turn a pointer position into an offset from that center by subtracting centerX and centerY from clientX and clientY. section 10.2.3
- Treat the difference between two points as the input for direction, distance, and rotation calculations. section 10.1 section 10.2.3
Pointer-driven card tilt
For a hover effect, first calculate the card’s center point from getBoundingClientRect(). Subtract that point from the mouse point to get center-relative x and y values. Their distance controls tilt intensity: a pointer near the center produces less rotation, while one nearer an edge produces more. Angle and trigonometric calculations then turn that relative position into horizontal and vertical rotation values. section 10.2.3
Table 1.7 Some geometric examples
Compare retrieving a mouse point, drawing between two canvas points, and rotating an element in concise browser code. section 1.4.7



