1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?xml version="1.0" encoding="UTF-8" ?>
<drgenius>
<drgeo grid="False" name="Curve and slope" origin_x="0.0" origin_y="0.0" scale="34.0">
<point color="Red" delta="7@7" id="840090166" masked="True" name="" style="Cross" thickness="Normal" type="Free">
<x>-10.61764705882353</x>
<y>-2.911764705882353</y></point>
<point color="Red" delta="7@7" id="1063364972" masked="True" name="" style="Cross" thickness="Normal" type="Free">
<x>7.323529411764706</x>
<y>-2.88235294117647</y></point>
<segment anchor="0.5" arrow="makeNoArrows" color="Black" delta="7@7" id="104162048" masked="True" name="" style="plain" thickness="Normal" type="2pts">
<parent ref="840090166"/>
<parent ref="1063364972"/> </segment>
<point color="Red" delta="-22.0@11.0" id="94351925" masked="False" name="Move me!" style="Rectangular" thickness="Thick" type="On_curve">
<parent ref="104162048"/>
<value>0.1786235457577283</value></point>
<value color="Black" delta="7@7" id="107910664" masked="False" name="" type="script">
<parent ref="94351925"/>
<code>pointM: item "Given a point calculate the y value from myFunction and the x valule of the point" 	^ item point x @(self myFunction value: item point x)</code>
<x>-9.5</x>
<y>-3.911764705882354</y></value>
<point color="Red" delta="7@7" id="166198067" masked="False" name="" style="Cross" thickness="Dashed" type="Script">
<parent ref="107910664"/> </point>
<locus anchor="0.5" arrow="makeNoArrows" color="Blue" delta="7@7" id="91315383" masked="False" name="" style="plain" thickness="Thick" type="2pts">
<parent ref="94351925"/>
<parent ref="166198067"/> </locus>
<value color="Black" delta="7@7" id="103400232" masked="False" name="" type="script">
<parent ref="94351925"/>
<code>slope: item 	"Compute the slopte at the given x point position for myFunction" 	| f x| 	f := self myFunction. 	x := item point x. 	^ (f value: x + 0.001) - (f value: x) / 0.001</code>
<x>-2.705882352941177</x>
<y>-3.941176470588236</y></value>
<value color="Black" delta="7@7" id="142984133" masked="False" name="" type="script">
<parent ref="166198067"/>
<code>pointN: item "Calculate the coordinate of a point on the tangente at the given point position" 	|p x| 	p := self slope: item. 	x := item point x + 1. 	^ x @ (item point y + p)</code>
<x>-0.529411764705882</x>
<y>-4.14705882352941</y></value>
<point color="Red" delta="7@7" id="244013658" masked="False" name="" style="Cross" thickness="Dashed" type="Script">
<parent ref="142984133"/> </point>
<line anchor="0.5" color="Brown" delta="7@7" id="187836632" masked="False" name="" style="plain" thickness="Normal" type="2pts">
<parent ref="166198067"/>
<parent ref="244013658"/> </line>
<value color="Black" delta="7@7" id="273245232" masked="False" name="" type="script">
<code>myFunction 	^ [:x | x cos]</code>
<x>-6.205882352941176</x>
<y>-3.85294117647059</y></value></drgeo></drgenius>
|