Menu

#1457 f1(x)=sin(x+pi*(4/3)) isn't plotted correctly

closed-invalid
nobody
None
5
2015-03-23
2014-08-05
Oliver
No

f1(x)=sin(x+ pi*(4/3))
should be equal and look like:

f2(x)=sin(x+ (pi/3)4)
f3(x)=sin(x+ pi
4/3)
f4(x)=sin(x+ pi/34)
f5(x)=sin(x+(pi
4)/3))
but isn't.

It looks like that gnuplot ignores the expression "*(4/3)" in f1(x),
because f1(x) is plotted like f6(x)=sin(x+ pi)

This was tested on
G N U P L O T
Version 4.6 patchlevel 4 last modified 2013-10-02
Build System: Linux x86_64
Kubuntu 14.04

Discussion

  • Oliver

    Oliver - 2014-08-05

    The board software removed the multiplication sign.
    I hope this here works now:

        f1(x)=sin(x+pi*(4/3))
        f2(x)=sin(x+ (pi/3) * 4)
        f3(x)=sin(x+ pi * 4/3)
        f4(x)=sin(x+pi / 3 * 4)
        f5(x)=sin(x+(pi * 4)/3)
        f6(x)=sin(x+pi)
    
     
  • Ethan Merritt

    Ethan Merritt - 2014-08-05
    • status: open --> open-invalid
     
  • Ethan Merritt

    Ethan Merritt - 2014-08-05

    Gnuplot uses integer arithmetic, so (4/3) evaluates to 1.
    Anything times 1 is 1.

    You want

    f1(x) = sin(x + pi * (4./3.))
    
     
  • Oliver

    Oliver - 2014-08-05

    Didn't knew that, sorry and thanks for clarification.

     
  • Ethan Merritt

    Ethan Merritt - 2014-08-14
    • status: open-invalid --> closed-invalid
     

Log in to post a comment.