TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to draw smooth lines through points using HTML5 canvas

14 pointsby abdiasover 11 years ago

1 comment

drifkinover 11 years ago
Since HTML5 canvas has support for drawing Bezier splines, another approach to drawing smooth lines through points is to use a Catmull-Rom spline. This gives the benefit of using the browser's native curve drawing routines. This might lead to better performance, or smoother looking curves, though it appears that this implementation's adaptive segmentation looks pretty good.