Plot the sin curve along the line y=x

R

Rbp9ad

This is more of a math question than a charting one. I am trying to plot the
sin curve rotated by 45 degrees. I started by plotting points for the
equation y = x + sin(x). This resulted in a skewing of
the curve. I want the sin curve to be determined by the distance traveled
along and symmetrical around the line y = x.
 
B

Bernard Liengme

Let's do it all in radians
Row 1: A1 blank, B1:'Radian',, C1:'Sin'
A2:A102: 0, 0.2, 0.4.... 2.0 (use Fill to get this)
B2: =SIN(A2) and copy down to B102

Now we need the transformation; stolen from website
http://www.bookrags.com/sciences/mathematics/transformations-mmat-04.html
R(x, y) = [xcos(t) - ysin(t)], [xsin(t) + ycos(t)]. If t is positive, the
direction of the rotation is counterclockwise; if t is negative, then the
rotation is clockwise

In D1 enter =SIN(RADIANS(45)) and since SIN(45)=COS(45) we will use this for
both
In E1: 'x-value'; F1: 'y-value'
In E2: =B2*$D$1-C2*$D$1 and in F2: =B2*$D$1+C2*$D$1
Copy down to row 102

Make graph using E1:F102
Add a 45degree line if needed

File to OP by private posting
 
G

Guest

Hi,

Let's assume that angles (in radians) are in A2:A101, and their sine values
are in B2:B101, and the angle (in degrees) by which you want to 'rotate' the
sine plot is in E1 (in your example, 45 degrees). Convert that angle into
radians in F1, with the formula =E1*PI()/180.
You are going to create two new columns, C2:C101 and D2:D101. If A2=0 (and
therefore B2=0), enter zeros in C2 and D2. In C3 and D3 enter the following
formulas, and autofill down to C101 and D101.

In C3, =SQRT(A3^2+B3^2)*COS(ATAN(B3/A3)+$F$1)
In D3, =SQRT(A3^2+B3^2)*SIN(ATAN(B3/A3)+$F$1)

Make a plot of D2:D101 (y-values vs C2:C101 (x-values).

You can change the angle of rotation in whatever value you want, and the
sine curve would automatically 'tilt' to that angle.

If you want to show the 'tilted' axis of the sine curve on the graph, enter
zeros in E2 and F2. Enter a number such as 20 in G2 (This is just a scaling
factor).
In E3, =$G$2*COS($F$1)
IN F3, =$G$2*SIN($F$1)

Add a series to your graph with F2:F3 (Y-values) vs E2:E3 (x-values). You
can adjust the length of that line by changing the number in G2.

Regards,
B. R. Ramachandran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top