W3C home > Mailing lists > Public > www-svg@w3.org > January 2010

Re: Tangent Angle At A Path Point

From: Doug Schepers <schepers@w3.org>
Date: Thu, 21 Jan 2010 09:23:12 -0500
Message-ID: <4B586350.2000105@w3.org>
To: Francis Hemsher <fhemsher@gmail.com>, www-svg@w3.org
Hi, Francis-

Francis Hemsher wrote (on 1/20/10 8:21 PM):
> I could use the tangent angle at various points, or lengths,  along a
> path. This would be used to both offset and align elements along a
> path at the same
> angle as the path at various points(or lengths). e.g.
> var tangent=myPath.getTangentAtPoint(x,y)
> or
> var tangent=myPath.getTangentAtLength(length)
> Is this possible with current SVG?

I don't believe so.

> Also, does anyone else see the need for this as a DOM interface?

I would like to have this, if browsers are willing to implement it.  It 
is useful for all sorts of non-rectilinear layout and custom animation.

Note that the UA needs to have code to do this anyway for textPath and 
animateMotion, it would just be a matter of exposing that code via a DOM 

In general, I think that SVG could benefit from a richer set of 
geometric and graphical methods, in addition to the normal DOM APIs for 
the markup that are applicable to any language.  I think these helper 
methods would also be useful for Canvas.

Here's a few sorts of things it would be nice to have a more complete 
treatment of in the API:
* vectors
* matrixes (SVG has a pretty good treatment of these, but could be improved)
* lines
* angles
* planes (maybe? could be relevant in pseudo-3D transforms)
* intersection / collision detection
* ?

What do people think?

-Doug Schepers
W3C Team Contact, SVG and WebApps WGs
Received on Thursday, 21 January 2010 14:23:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:19 UTC