Click here to Skip to main content
15,886,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
haw to make equation in gui code (pow x,(2*x+3)/POW(x+3,0.5))//logx +4sin(x/5)
to draw that equation in graph
Posted
Updated 19-Jun-11 22:26pm
v2

1 solution

What as to do with ATL, your question?
Anyway, you may

  • Choose the x-range.
  • For each x evaluate the corrensponding y using the equation: you'll end up with an array of points.
  • Find out the y-range using the array of points.
  • Compute the {x, y} scale factors and offsets.
  • Use the graphics primitive of your system to draw the trasnformed points (translated and scaled) to the screen and connect them with lines.


If you are using Windows, the raw GDI functions like MoveToEx[^], LineTo[^] provides the functionalities required (you may use GDI+ for smoother output).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900