4

I am making an app where I need to draw a sine wave between two given points. I have Google'd, and Google'd, and I haven't found anything that I have found suitable.

Is there an efficient way in android to use some pre defined points to draw a smooth wave like form?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
DingleNutZ
  • 163
  • 1
  • 7
  • I am not sure what you are asking here. There are at least three ways to interpret what you just said. Do you: 1. Want the equation for a parametric curve passing through 2 points which has sinusoidal oscillations? 2. Want to interpolate a triangle wave with a sine wave? 3. Just want to know how to quickly plot a sine wave? – Mikola Jun 28 '11 at 03:31
  • looking for the interpolation if you know. the wavelength is the same for the whole wave, but the amplitude is random for each point – DingleNutZ Jun 28 '11 at 03:41
  • 1
    that doesn't make much sense. What you are asking for is not a sine wave then, but is in fact something else. If you can vary the amplitude freely, you can make any function you want. – Mikola Jun 28 '11 at 03:46
  • 1
    Bit late but look at my similar problem and how I solved it http://stackoverflow.com/a/19520120/1112882 – M-Wajeeh Oct 22 '13 at 14:08

1 Answers1

5

You can use the android.graphics.Path class to construct a set of quadratic or cubic Bézier spline curves between your set of control points.

Jim Lewis
  • 43,505
  • 7
  • 82
  • 96