+ Reply to Thread
Results 1 to 4 of 4

Plot the sin curve along the line y=x

  1. #1
    Rbp9ad
    Guest

    Plot the sin curve along the line y=x

    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.



  2. #2
    Tushar Mehta
    Guest

    Re: Plot the sin curve along the line y=x

    One way of interpreting what you wrote is to plot y=x*sin(x). For the
    rotation bit see
    Case Study =3F Rotate and mirror image charts
    http://www.tushar-mehta.com/excel/ti...0invert%20and%
    20rotate.pdf

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <uABbLXXBGHA.1124@TK2MSFTNGP10.phx.gbl>,
    rob.patterson@lightcore.net says...
    > 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.
    >
    >
    >


  3. #3
    Bernard Liengme
    Guest

    Re: Plot the sin curve along the line y=x

    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/mat...s-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
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Rbp9ad" <rob.patterson@lightcore.net> wrote in message
    news:uABbLXXBGHA.1124@TK2MSFTNGP10.phx.gbl...
    > 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.
    >




  4. #4
    B. R.Ramachandran
    Guest

    RE: Plot the sin curve along the line y=x

    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


    "Rbp9ad" wrote:

    > 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.
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1