Uploaded June 2023 | Updated September 2026, 2 weeks ago
When we measure distances in the real world, we⦠donāt really use the Pythagorean theorem⦠We use a ruler of some kind. We just move the ruler so that one point is at the start and just read the value at the other point⦠No fancy math. Or is there some hidden math when doing this? Weāll see⦠In this video Iāll show you how to teach the computer to measure distances in the same way we do and then compare which is better. Iāll code this experiment from scratch using vanilla JavaScript and HTML canvas.
We use techniques like canvas rotation and translation to orient the points horizontally and then investigate the pixels to see where they are in this new view and calculate the distance.
ā LINKS ā
Vectors (and the atan2 method):
youtu.be/nzyOCd9FcCA
Pythagorean Theorem:
youtu.be/iqSlzYXdFzw
When we measure distances in the real world, we⦠donāt really use the Pythagorean theorem⦠We use a ruler of some kind. We just move the ruler so that one point is at the start and just read the value at the other point⦠No fancy math. Or is there some hidden math when doing this? Weāll see⦠In this video Iāll show you how to teach the computer to measure distances in the same way we do and then compare which is better. Iāll code this experiment from scratch using vanilla JavaScript and HTML canvas.
We use techniques like canvas rotation and translation to orient the points horizontally and then investigate the pixels to see where they are in this new view and calculate the distance.
ā LINKS ā
Vectors (and the atan2 method):
youtu.be/nzyOCd9FcCA
Pythagorean Theorem:
youtu.be/iqSlzYXdFzw







![Self-driving car - No libraries - JavaScript course [Lecture 8]
Self-driving car - No libraries - JavaScript course [Lecture 8] Self-driving car - No libraries - JavaScript course [Lecture 8]](https://i.ytimg.com/vi/hVctn8x3jMA/mqdefault.jpg)


