Integral (simple 3d)

Help Contents Examples Integral (simple 3d)
Icosahedron (3d) Lines (simple)

Integral (simple 3d)

Example:   Integral
File name: Integral.eli
Modified:  May 19, 2000
Author:    Pavel Christov Boychev
Version:   5.0
E-mail:    pavel@elica.net

Copyright © 1999-2000 Elica Group

This example shows how to manually draw a mathematical expression.

run "graphix

; Define the point of view change procedure
make "z 0
make "focus vector 0 0 0
make "updir vector 0 0 1

to changeview
	make "eye vector 3*(cos :z) 3*(sin :z) 3+2*(sin :z)
	lookat :eye :focus :updir
	make "z :z+2
end

; Prepare all needed fonts
make "symbol font "'Symbol' 0
make "times font "'Times New Roman' 0

; Draw the black rectangle
(make "rec 
	styled (rectangle point -0.6 -0.2 -0.01 1.8 1.1) 
		(set "color rgb_ 0.1 0.2 0.3 "smooth "false "mode 2)
)
; Draw a frame around it
(make "rec1 
	styled (rectangle point -0.65 -0.25 -0.01 1.9 1.2) 
		(set "color rgb_ 0.1 0.2 0.3 "smooth "false)
)

; It is better to define a child of the Graphix"s
; object Text, because we want to embed some of
; the text"s properties - mode, size and color.

to mytext :string :font :center :size

	run bf :text
	make local "mode 2

	if local? "size
	[
		make local "radius :size
	]
	make local "radiusz 1
	make local "color rgb_ 1 1 1
end

; Now, let's construct the formula - piece by piece

make "t1 mytext "ò        :symbol (point -0.6   0    0) 1
make "t3 mytext "'x   dx' :times  (point -0.3   0.12 0) 0.7
make "t6 mytext "S        :symbol (point -0.02  0.3  0) 0.4
make "t7 mytext "k        :times  (point  0.06  0.2  0) 0.12
make "t8 mytext "'A(k)'   :times  (point  0.17  0.35 0) 0.2

; To make things more attractive, the point
; of view is changed 3000 times.

repeat 3000 [ changeview ]

Icosahedron (3d) Lines (simple)