Hi there,
  I made a quick demo that I will develop further.  The code is
excessively bloated so I would not include it in my posts unless you
guys really want it, I included only the minimum.  I have a problem
that involves math and client-side optimisiation/javascript.

Check out my compiled demo here:  http://www.n32.ca/sin.cgi
When you click the vector image, the spiral redraws.  This sin.cgi
currently use VML to draw vector graphic in IE and PNG for others.

My concerns is that while IE can take advantage of VML to draw the
image, all implementation will have to query the server for the X,Y
positions of the lines.
The formula for the positions is this C code:

 for(double k=0; k<=n; k++){
      double p = (1-cos(1*M_PI*k/n))/2;
      double a = r*2.0*M_PI*p;
      double d = p + 0.075*sin(q*2*M_PI*p+t);
      double newX = d*cos(a);
      double newY = d*sin(a);
      if(k>0) painter.drawLine(lastX,lastY,newX,newY);
[...] }

So the problem here is that the whole position algo is written in C.
And to be optimized, it would need to be written in javascript.  I
could do that, but if in some other project the server needs to
calculate stuff using the same algo as the client, I would have to
write the formulas in both code.  But maintenance would easily become
a nightmare.

Does Wt provide a solution for this?
If not, I was already programming a C++ math abstraction class
hierarchy that allows to build formulas and custom math functions...
I had left it in the freezer for the past month or so but I thought I
could modify it to yield valid javascript code for the computation.
The result would be the same code as above, but using another type
than double (like, say, WMath).
Is this something of interest to you guys?  I'd like to work on
something like this, but I'd rather avoid rebuilding the wheel...!  =)

Simon

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to