分形编程
学习分形编程是否有助于清晰地思考某些编程问题?
Would learning to program fractals help think clearly about certain set of programming problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
学习分形编程是否有助于清晰地思考某些编程问题?
Would learning to program fractals help think clearly about certain set of programming problems?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(11)
任何类型的编程经验都是有用的。 所以是的。
特别适用于:
Any kind of programming experience is useful. So yes it is.
Especially for:
它可能会给你练习应用数学公式的机会。
It'll maybe give you practice in implementing mathematical formulae.
一些分形是显式递归的良好视觉示例; 如果你很难理解这个概念,那么它们可能是很好的解决方案。 您可以从“海龟图形”样式的分形路径开始,例如希尔伯特曲线或经典的“雪花”分形。
许多分形生成方法都使用重型数字运算(例如,Mandelbrot 和 Julia 集)。 当然,数字运算本身就是一个领域,调整分形生成器以尽可能快地运行可能是一个很好的优化练习。
Some fractals are good visual examples for explicit recursion; if you have a hard time with that concept, they might be good problems to work. You can start with "turtle graphics" style fractal paths like the Hilbert curve, or the classic "snowflake" fractal.
Many fractal-generation methods use heavy-duty number crunching (e.g., Mandelbrot and Julia sets). Number crunching is of course a field in itself, and tweaking your fractal generator to run as fast as possible can be a nice exercise in optimization.
我不认为分形编程会教给你任何特别的东西。 根据分形的不同,我想它可能会教你一些关于数学或分形的知识。
然而,我确实认为分形作为编程的入门很有趣,初学者/学生常常对结果着迷,无论是像曼德尔布罗或朱莉娅集这样更图形的分形,还是更容易理解的 L 系统。
当然,如果您是编程新手,它也有望教会您很多有关编程的一般知识。 如果不出意外的话,分形看起来很有趣。
I don't think programming fractals will teach you anything in particular. Depending on the fractal, I suppose it might teach you a bit about math or fractals in general.
However, I do think fractals are fun as an introduction to programming, and beginners/students are often fascinated by the result, be it more graphic fractals like mandelbrot or julia sets, or more easy to understand L-systems.
Of course, if you're new to programming, it'll also hopefully teach you a lot about programming in general. If nothing else, fractals are interesting to look at.
当我还是一名本科生时,我们使用分形绘图来支持我们的并行处理工作。 它的计算量很快就会变得相当大,因此使用多个 CPU 来完成工作可以让您看到效率的明显提高。
因此,除了递归之外,我认为它有助于学习如何平衡并行处理器之间的 CPU 负载。
...或者如果没有可用的设备,它可能会教你禅宗般的耐心。 :)
when I was an undergrad, we used fractal drawing to power our work in parellel processing. It gets fairly computationally intensive quickly, so having multiple CPUs available to do the work lets you see a visible increase in efficiency.
So, along with recursion, I'd say it helps with learning how to balance CPU load across parallel processors.
... or if the equipment isn't available, it probably teaches you Zen-like patience. :)
好想法! 我认为对分形进行编码可以成为一个很棒的“练习曲”(研究)大小的程序。 这样它有一些不错的功能:通常您不需要太多的第三方代码,它们可以在相当短的时间(和复杂性)内实现,并且您最终也会得到一些不错的东西,这也验证了您的工作。
此外,如果您这样做,您还会遇到大量数学和数值算法实现方面的基本问题。
从像基本曼德尔布罗特集生成器这样简单的东西,你可以扩展到评论者提到的各种问题。 即使坚持这一点,你也可以学习优化技术(为什么我的生成器这么慢)和数值问题(为什么我不能在这里放大),而且如果你想了解一些颜色理论(什么是 L ab* 空间无论如何)和其他零碎的东西。
玩得开心!
Great idea! I think coding up fractals makes a great "etude" (study) sized program. It has some nice features this way: generally you won't require much 3rd party code, they can be implemented in a reasonably short amount of time (and complexity) and you get something nice too look at in the end which also verifies your work.
Also there are loads of basic issues in both mathematics and the implementation of numerical algorithms that you will bump into if you do this.
From something as simple as a basic Mandelbrot set generator you can branch out into all sorts of issues as commenters have mentioned. Even sticking with just that, though, you can learn about optimization techniques (why is my generator so slow) and numerical issues (why can't I zoom past here), but also if you want to a bit of color theory (what's Lab* space anyway) and other bits and pieces.
Have fun!
分形是一个非常有趣的话题,即使是最简单的实现也能让你了解复数数学、图形生成、缩放图像和一般编程。
Fractals is a very intellectually interesting topic and well even the simplest implementation will make you learn about complex number maths,graphics generation,scaling images, and general programming.
分形编程将向您介绍递归、迭代、图形编程概念、图像处理和用户界面设计。 从数学的角度来看,您将学习几何、复数、莫比乌斯变换(克莱因分形)、仿射变换(IFS 分形)、求根方法(牛顿分形)。
最重要的是,你会得到回报,看到你的努力产生了奇怪和不寻常的图像。
Fractal programming would introduce you to recursion, iteration, graphics programming concepts, image processing, and user interface design. From a mathematics point of view, you would learn about geometry, complex numbers, Mobius transformations (Kleinian fractals), Affine transformation (IFS fractals), root-finding methods (Newton fractals).
And on top of all this, you get the reward of seeing your efforts result in strange and unusual images.
据我记得,如果没有别的事情,你会很好地处理递归......也许还有一点位图级编程......
From what I remember you'll get a good handle on recursion if nothing else...maybe a little bitmap level programming as well...
如果您是初学者,这样的活动肯定会帮助您提高技能。 除此之外,根据分形类型和您设定的目标进行分形可视化编程可能会给您一些特定的技能或知识,例如:
结构;
(例如为什么分辨率会是
通常有限-> 浮点
精度和误差累积);
扩大你的兴趣范围;
(例如,您可以代码Mandelbrot
在 PixelBender 中设置,即
非常快,因为可能会执行
图形处理器);
算法(例如某种分形
压缩);
分形集着色算法);
这确实是一个多才多艺且有趣的领域,有很多东西值得探索和学习。 我曾经经常画分形:)
If you are a beginner such activity will surely help you to improve your skills. Apart from that programming fractal visualizations depending on the fractal type and the goal you set may give you some specific skills or knowledge like:
structures;
(e.g. why resolution would be
normally limited -> floating point
precision and error accumulation);
extend your range of interest;
(e.g. you can code Mandelbrot
set in PixelBender which is
really fast since may be executed on
GPU);
algorithms (e.g. some kind of fractal
compression);
fractal set coloring algorithm);
It is indeed a versatile and interesting field, lots of things to explore and learn. I used to draw fractals a lot :)
分形让我思考复数和分支点。 我认为这是否是一件好事,这是一个见仁见智的问题。 :-)
Fractals got me thinking about complex numbers and branch-points. Whether that was a good thing is, I suppose, a matter of opinion. :-)