在点周围绘制直线和椭圆 [英] Graphing lines and ellipses around points

查看:73
本文介绍了在点周围绘制直线和椭圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用C#编写了一个程序,该程序需要比典型线图更多的打印选项.我确实需要根据点绘制一条线,但是我还需要根据+/- x和y值在该线上的不同点周围绘制椭圆.我希望这是有道理的.基本上,我只需要能够绘制4个点,然后绘制一条平滑的曲线将它们连接起来并重复.

我已经尝试了Steema TeeChart(用于另一个项目)和Zedgraph的较旧版本,但是都不够用. Zedgraph可以让您绘制椭圆,但是它的形状像泪珠.我还研究了其他几项,但是没有迹象表明它们会有所不同.

我想一个选择是自己完成所有工作并学习如何制作图形,但这将是一项艰巨的任务,因为我对此没有经验.我见过其他专业程序对3D图形做类似的事情,但不确定如何完成.

有关如何执行此操作的任何想法或建议?在此先感谢.

I have written a program in C# that requires more plotting options that the typical line plot. I do need to plot a line based on points but I also need to plot ellipses around different points on that line based on +/- x and y values. I hope that makes sense. Basically, I just need to be able to plot 4 points then draw a smooth, curved line connecting them and repeat.

I have tried an older version of Steema TeeChart (used on another project) and Zedgraph but both fall short. Zedgraph kind of lets you draw an ellipse but it comes out shaped like a teardrop. I have also researched several others but see no signs that they will be any different.

I suppose one option is to do it all myself and learn how to do graphics but that would be a huge task since I have no experience with that. I have seen other professional programs do similar things with 3D graphics but not sure how that was accomplished.

Any thoughts or suggestions on how to do this? Thanks in advance.

推荐答案


如果库没有提供您不需要的功能,我强烈建议您自己进行所有绘图.这是完全可行的(Mark为您提供了一种有用的技术).当然,这是非常笼统的答案;也许有人会给你更好的主意.

您会看到,人们经常低估了使用某人的代码所浪费的时间,因为即使无意中浪费了很多时间并且没有得到结果,但在无意识的情况下挖掘这样的解决方案仍然是很不合理的.当然,如果您的结果满足您的要求,那么自己动手可能会更容易,而且肯定是更有用的做法.

另一个想法是切换到WPF,它更适合于绘图和制图. (我并不是说总体上比较容易,但是对于绘图/作图来说,这种方法更加自然,您无需关心渲染;而且性能要好得多.)

祝你好运,
—SA
I would strongly advice doing all the plotting by yourself, if the libraries does not give your the features you don''t need. This is quite doable (Mark gives you one useful technique). Of course, this is very general answer; maybe somebody will give you better idea.

You see, people often underestimate the time wasted on using someone''s code because digging in such solutions unconsciously perceived as "not real work", even though more time is wasted and result is not achieved. Doing it yourself might be easier and certainly more useful practice — if your results satisfy your, of course.

Another idea is switching to WPF, much better suited for plotting and diagramming. (I didn''t say it''s easier in general, but for plotting/diagramming the approach is way more natural, you don''t care about rendering; and performance is much better.)

Good luck,
—SA


如果您精通数学,可以看看以下内容:

http://cqvis.zxq.net/C6/VQC176.jpg [
If you''re good with math, you might have a look at this:

http://cqvis.zxq.net/C6/VQC176.jpg[^]


这篇关于在点周围绘制直线和椭圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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