Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, April 2008
Peak in QPainterPath


Message 1 in thread

Hi,

i don't even know if the subject is correct but i'm trying to achieve 
the following:
i got a QPainterPath.cubicTo(...)
now i want to find the peak of this curve (if i remember correctly that 
would be where the second derivation of the curve is 0). (unfortunately 
that's not pointAtPercent(0.5) and i couldn't find any other method that 
would help me).

Qt offers a slopeAtPercent method for QPainterPath - but that doesn't 
help me either (for that's the first derivation).

Any suggestions or pointers where i could find more informations welcome.

Thx,

RZ

--
 [ signature omitted ] 

Message 2 in thread

I'm a bit puzzled about what you're trying to achieve here.

If you want to iterate through a certain percent range and look for the 2nd derivation that is 0, why don't you just look for the percantage that gives you the "highest" pointAtPercent?

If you want to solve this analytically, you're wrong: you need to be looking for the first derivation to be 0. But then it could also be a minimum, to be sure of that, you'd have to look at the second derivation.

Cheers,
Peter

> -----Ursprüngliche Nachricht-----
> Von: RZ [mailto:rz@xxxxxxxxxxxx] 
> Gesendet: Sonntag, 20. April 2008 00:02
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Peak in QPainterPath
> 
> Hi,
> 
> i don't even know if the subject is correct but i'm trying to achieve 
> the following:
> i got a QPainterPath.cubicTo(...)
> now i want to find the peak of this curve (if i remember 
> correctly that 
> would be where the second derivation of the curve is 0). 
> (unfortunately 
> that's not pointAtPercent(0.5) and i couldn't find any other 
> method that 
> would help me).
> 
> Qt offers a slopeAtPercent method for QPainterPath - but that doesn't 
> help me either (for that's the first derivation).
> 
> Any suggestions or pointers where i could find more 
> informations welcome.
> 
> Thx,
> 
> RZ

--
 [ signature omitted ]