如何用C ++ Builder制作一个变量函数的图形。 [英] How to Make graph of a function of one variable with C++ Builder.

查看:119
本文介绍了如何用C ++ Builder制作一个变量函数的图形。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿朋友们,我必须用C ++ Builder绘制一个变量函数的图形。但是没有İdea要做:(有人可以帮我们输入一个变量方程而不是图表方程式...感谢所有...

解决方案

为了代表一个函数你可以:

  1. X 感兴趣的范围的(多个)点处对函数进行抽样,获得 {x,y = f(x)} 对的数组。
  2. 使用这样的数组绘制函数图(作为第一个适当的你可以直接绘制连接点的线。)





点(1)非常简单。

点(2)要求:

  • 操纵 {x,y} 值以适应屏幕绘图矩形(即翻译和点的比例)
  • 使用 C ++ 构建器知道绘图原语(关于参数有很多教程,你可能会看到只使用< a href =http://www.google.co.uk/#rlz=1C2CHFX_itIT503IT534&sclient=psy-ab&q=drawing+with+c%2B%2 B +助洗剂&安培; OQ =绘图+与+ C%2B%2B +助洗剂&安培; gs_l = serp.3..0i22i30.3160.3160.0.3730.1.1.0.0.0.0.149.149.0j1.1.0 ... 0.0.0 .. 1c.1.15.psy-ab.yTVoUJ_iKi8& pbx = 1& bav = on.2,or.r_qf。& fp = af586b6f14c6622b& biw = 1090& bih = 745> Google [ ^ ])。

Hey Friends , I must graph of a function of one variable with C++ Builder. But No İdea to make :( someone who can help we can input One variable equation than graph the equation ...Thanks to for all...

解决方案

In order to represent a function you may:

  1. Sample the function at (many) points of the X range of interest, obtaining an array of {x,y=f(x)} pairs.
  2. Draw the function graph using such array (as first appropximation you may draw straight lines connecting the points).



Point (1) is pretty straightforward.
Point (2) requires:

  • manipulating the {x,y} values in order to fit into the screen drawing rectangle (that is translation and scale of the points)
  • Knowing ho to drawing primitives using C++ builder (there are many tutorials on the argument, as you may see just using Google[^]).


这篇关于如何用C ++ Builder制作一个变量函数的图形。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆