Re: Curve recommendations



On Feb 12, 7:52 am, RossClem...@xxxxxxxxx wrote:
On Feb 12, 1:36 am, matt271829-n...@xxxxxxxxxxx wrote:





On Feb 11, 2:15 pm, RossClem...@xxxxxxxxx wrote:

Dear all,

I would like to use "interesting curves" for "sliders" on software
music synthesisers. Typically these synths will have "sliders" which
are a vertical or horizontal line, along which a point can be dragged
from say minimum value (bottom or left of the line) to maximum value
(top or right of the line). I'd like to use other shapes other than a
straight line. For example, I could use an arc from a circle. When
dragging the point along the arc, I'd be calculating the closest
position between the arc and the mouse position (x,y), and moving the
point on the arc representing the parameter value to that point. I'd
also need to extract the parameter value from that

If I use an arc from a circle, then I can easily find the minimum
distance between any point and the arc. I can then easily turn that
into a %age value along the arc by extracting the angle from the
origin to that point, and comparing to the minimum and maximum values
for the arc. Job done, if I was sensible.

However, I'm wondering if there are other interesting curves which I
could use. As far as I can see, any function  where I can solve for x'
and f(x') (the closest point) from the mouse click (x,y)

d (x-x')*(x-x') + (f(x')-y') * (f(x')-y') d x' = 0

and where there is a single, or at least a small number of minimums/
maximums. It would also help if I could quickly convert x',f(x') into
a %age along the visible curve. The domain of x' can be chosen
arbitrarily.

What I'd like to ask is if there are any "interesting" curves that
might be worth looking into. S shaped curves and the like.

I should warn people that I have no strong reason or requirement to do
this, it's just an "interesting problem".

Any recommendations/comments?

I can't figure this out. If all you're doing by sliding the point is
ending up with a single percentage value "along the curve", then what
is the purpose of using anything other than a straight line? What
difference does it make? (Or is that what you mean by having no strong
reason or requirement to do it? Is it just to make the thing look sexy
perhaps?)

Yes, that is the sole reason. To make the thing look sexy.

The requirement to solve the closest-point and arc-length equations
analytically seems to quite drastically limit your choice of curve.
Maybe you could drop that requirement and instead use numerical
approximations, especially since the accuracy needed is presumably low
-- no more than one part in however many pixels the slider extends to.
You might even get away with a dumb distance check on each pixel
positition along the curve.

Another possibility would be to splice together circular arcs. Two of
these should give you a reasonably decent S-shape. Then you can solve
the equations individually for the arcs and get your answer that way.
.



Relevant Pages

  • Re: sin x / x tends to 1...
    ... >>>polygon stuff, which we can regard as mere detail, you (and one or two ... But if you think about what it is saying, ... >arc length and the length of the "ruler" will become insignificant. ... It's saying that the length of a certain curve is ...
    (sci.math)
  • Re: Area and volume of solid of revolution
    ... Because we do not need to know the arc length of a curve ... you mean integrating the formula ... Let's find the volume of a unit sphere and the ...
    (sci.math)
  • Re: arc length of quadratic curve
    ... the point is that if you know how to measure arc length of a straight ... Can we not think of a curve as a series of connected straight line segments? ... divisions we get a better approximation and in the limit one has the "true" ... can I use the same function for quadratic curve also or what can be ...
    (comp.graphics.algorithms)
  • Re: Windshield Height Question
    ... Take a large piece of art paper, tape it tightly around the entire top half of the w/s with some overlapping the top. ... That's more or less what I did the last time, but you can't just slide the curve down. ... when you slide the curve down you have to adjust the lower end points so that they match the existing edge points of the original windshield. ... That changes the arc considerably. ...
    (rec.motorcycles.harley)
  • Re: Calculus XOR Probability
    ... Your statement of "infinite induction" includes no such definition. ... One can define a curve as being a continuous image of a real interval ... limiting curve is not sufficient for preserving arc length. ... what we mean by the words we use; and mathematics is the domain ...
    (sci.math)