|
From: | Hilaire Fernandes |
Subject: | Re: [Dr. Geo] proportionOf:to: method ? |
Date: | Sat, 18 May 2024 10:25:36 +0200 |
User-agent: | Mozilla Thunderbird |
Hi David, What you want is something more generic, to compute a value from arbitrary code. Remember about https://github.com/hilaire/drgeo/issues/31 related to a discussion we had on this mailing list. So I appended these lines of code to your script to produce the expected results: (sketch value: [ AC mathItem length / BC mathItem length]) name: 'AC ÷ BC'. (sketch value: [:ptA :ptD :ptB :ptE | (ptA point dist: ptD point) / (ptB point dist: ptE point)] parents: {A . D . B . E} at: 0@5) name: 'AD ÷ BE' Observe in the code, two different ways to define
the value by block. The second one with arguments, in the
resulting sketch when you drag the value it shows you with red
dotted arrows the objects used for the computation, here points
A, D, B and E. Please update to latest DrGeo with a pull. When
restarting your DrGeo image the newer package should get load
automatically, this is a new feature of Cuis 6.3. If not, use
the FileList from the world menu and search for the DrGeo
package and install it manually. I append below a screenshot. Observe how the rendering of Cuis is far superior in quality to the rendered SVG file in your operating system: ![]()
Le 17/05/2024 à 21:42, stes@telenet.be
a écrit :
There exists an instance method lengthOf: for the class DrGeoSketch which returns the length of (for example) a segment of a line. That works for me, and when I interactively change in the DrGeo SmalltalkSketch Editor the segment between two points, the length value is also updated automatically. Is there an instance method which computes the constant of proportionality for two segments ? A method for DrGeoSketch : proportionOf:segment1 to:segment2 -- GNU Dr. Geo http://gnu.org/s/dr-geo/ http://gnu-drgeo.blogspot.com/ |
[Prev in Thread] | Current Thread | [Next in Thread] |