Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 Drawing a graph e.g. y=sin(x)

View previous topic View next topic Go down 
AuthorMessage
jayesjay



Number of posts : 2
Registration date : 2014-04-19

PostSubject: Drawing a graph e.g. y=sin(x)   Sat Apr 19, 2014 6:07 pm

Can you confirm that there is no graphing function in Pan...

Do I have to generate a file of graph numbers (x, y1, y2 etc) and open it in say Excel.
Back to top Go down
View user profile
papydall

avatar

Number of posts : 39
Age : 67
Localisation : TUNISIA
Registration date : 2013-03-16

PostSubject: Re: Drawing a graph e.g. y=sin(x)   Sun Apr 20, 2014 12:42 am

Hello jayesjay
If that can help you.

Code:
dim x,y,xc,yc,p
p = pi/180
xc = 250 : yc = 200 : ' Coordinates of the center
caption 0, "GRAPH OF Y = SIN(X)"
2d_pen_color 255,0,0
 2d_line 0,yc,2*xc,yc  :' Axis X
 2d_line xc,0,xc,2*yc  :' Axis Y
2d_pen_color 0,0,255 : 2d_poly_from 00,yc : ' origin of graph
for x = 0-8*pi to 8*pi step p
    y = sin(x)
    2d_poly_to xc+10*x, yc-100*y
next x

Code:
dim x,y,xc,yc,p
p = pi/180
xc = 250 : yc = 200 : ' Coordinates of the center
caption 0, "GRAPH OF Y = X/20 + SIN(X)"
2d_pen_color 255,0,0
 2d_line 0,yc,2*xc,yc  :' Axis X
 2d_line xc,0,xc,2*yc  :' Axis Y
2d_pen_color 0,0,255 : 2d_poly_from 00,yc : ' origin of graph
for x = 0-8*pi to 8*pi step p
    y = x/20 + sin(x)
    2d_poly_to xc+10*x, yc-100*y
next x

Code:
dim x,y,xc,yc,p
p = pi/180
xc = 250 : yc = 200 : ' Coordinates of the center
caption 0, "GRAPH OF Y = SIN(X) / X"
2d_pen_color 255,0,0
 2d_line 0,yc,2*xc,yc  :' Axis X
 2d_line xc,0,xc,2*yc  :' Axis Y
2d_pen_color 0,0,255 : 2d_poly_from 00,yc : ' origin of graph
for x = 0-8*pi to 8*pi step p
    y = sin(x)/x
    2d_poly_to xc+10*x, yc-200*y
next x
Back to top Go down
View user profile
 
Drawing a graph e.g. y=sin(x)
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Drawing Contest!
» Sean's Drawing Talent Come an take a look ^_^
» How to verify the graph?
» The Winner of Our Wii U Countdown Drawing Is Official!
» Put a Dent in Your Debt Sweepstakes *ABA-accredited law schools only*

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Help?-
Jump to: