Abhinav's link is good. However the simplified version of that solution is...
Xaml..
<Polyline Name="polyline1" Stroke="Red"
StrokeThickness="2"/>
code..
for (int i = 0; i < 70; i++)
{
double x = i * Math.PI;
double y = 40 + 30 * Math.Sin(x/10);
polyline1.Points.Add(new Point(x, y));
}
Where the 40 is simply a translation factor for the graphic. 30 is the amplitude. This is just to explain how a sinusoidal formed using trig instead of you just copy cat the code.
Improved Answer
---------------------
If need to draw a wavy polyline on a canvas using a start and end point then this function may help
public void drawWawyPolyline(Point start, Point end)
{
double x=0;
double y=0;
double distance = Math.Sqrt(Math.Pow((start.X - end.X), 2) + Math.Pow((start.Y - end.Y), 2));
Point refPoint = new Point(start.X + distance, start.Y);
double endX = (refPoint.X / Math.PI) + 1;
double angle1 = rad2deg(Math.Acos(Math.Abs((end.X - start.X)) / distance));
double angle2 = rad2deg(Math.Asin(Math.Abs((end.Y - start.Y)) / distance));
double angle = (angle1 + angle2) / 2;
for (double startX = start.X / Math.PI; startX <= endX; startX++)
{
x = startX * Math.PI;
y = start.Y + 10 * Math.Sin(x / 10);
polyline1.Points.Add(new Point(x, y));
}
RotateTransform trans = new RotateTransform(angle, start.X, start.Y);
polyline1.RenderTransform = trans;
}
private double deg2rad(double deg)
{
return Math.PI * deg / 180;
}
private double rad2deg(double rad)
{
return rad * (180 / Math.PI);
}