在图表上绘制线(y = 2x + 7) [英] Plot a line (y = 2x + 7) on a graph

查看:226
本文介绍了在图表上绘制线(y = 2x + 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#中的一个科学计算器。我有解析引擎等,现在我想添加一个图,所以用户可以绘制一条线。有没有任何种类的控制,让我输入一个函数,它会在图表中绘制一条线?



取斜率截距形式的线性方程,例如:

  f(x)= 2x + 7 

主要目的是允许用户在文本框中写入 2x + 7 ,然后它将绘制线条。最好是使用自定义函数而不仅仅是线性函数,例如:

 ((x  -  8)* 4 ^ 2)/(7.136 + x)

但不是必须的。这是否有第三方控制?



我已经下载了一个程序,用来绘制如下的函数:






解决方案

我搜索了

我在Visual C#2010 WinForms应用程序中如何实现这个功能? code> windows 的数学函数图库并找到:




  • FPlot a用于绘制函数的.NET库和测量数据(CodeProject上的项目)



,您可以尝试使用以下源代码:




  • MathGV


  • ul>

    您必须检查许可证。
    我没有尝试任何这些,顺便。


    I am working on a scientific calculator in C#. I have the parsing engine and such, now I would like to add a graph so the user can plot a line. Is there any kind of control that will let me input a function and it will graph a line in the chart? I'm not talking about plotting individual points by the way.

    Take this linear equation in slope-intercept form for instance:

    f(x) = 2x + 7
    

    The main goal is to allow the user to write 2x + 7 in a textbox, and then it will graph the line. It would be preferable if custom functions could be used other than just linear functions, such as:

    ((x - 8) * 4^2)/(7.136 + x)
    

    But it's not a requirement. Is there a third-party control for this? If not could someone give me general help on how I would create such a control?

    I have downloaded a program that graphs functions like this:

    Can anyone help me on how I can achieve this functionality in my Visual C# 2010 WinForms application?

    解决方案

    I searched for mathematical function plot library for windows and found this:

    • FPlot a ".NET library for plotting functions and measurement data" (a project on CodeProject)

    and you can try to use the source code of:

    You'll have to check the licenses. I didn't try any of these, by the way.

    这篇关于在图表上绘制线(y = 2x + 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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