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

Re: Draw curve by giving a mathematical function (feature request)

From: David Woolley <forums@david-woolley.me.uk>
Date: Mon, 22 Feb 2010 21:52:54 +0000
Message-ID: <4B82FCB6.9030203@david-woolley.me.uk>
To: www-svg@w3.org
CC: Tamás Laiszner <laisznertamas@gmail.com>
Tamás Laiszner wrote:

> I think it would be very useful if there were an opportunity to draw a 
> curve by giving directly a mathematical (or ECMAScript) function. Maybe 
> the ECMAScript Math object could be a good base to implement this. My 
> opinion is that it would have some really positive effects. I imagine it 
> like this:

I think this is an unreasonable mixing of technologies (although there 
are lots of precedents for such in W3C).  You are potentially using 
ECMAScript syntax in a declarative mode.

To achieve reasonable performance in this pseudo-declarative mode, you 
would need hints as to the sampling interval to use.

Tools that graph functions, like gnuplot,  typically have a parametric 
mode, as well as the simple y = f(x) mode.

> 
> <funcCoordSystem>
>     <func f="Math.sin(x)" d="(-2 * Math.PI; 2 * Math.PI)" />
>     <func f="Math.cos(x)" d="(-2 * Math.PI; 2 * Math.PI)" />
> </funcCoordSystem>


-- 
David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.
Received on Monday, 22 February 2010 21:53:27 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT