dr-geo
[Top][All Lists]

## [Dr. Geo] Re : Re: How do I indicate function values? (DrGeo DSL)

 From: H. Fernandes Subject: [Dr. Geo] Re : Re: How do I indicate function values? (DrGeo DSL) Date: Thu, 28 Dec 2023 21:31:04 +0100 (CET)

```You can define another point by block to get the y value dot:

sketch point: [0 @ mobile point y]

To define a locus, the dependent point depends on the mobile point. I. e. when
the mobile move, the dependent will move too

Dr. Geo -- http://drgeo.eu

----- H. Hirzel &lt;hannes.hirzel@gmail.com&gt; a écrit :
> Done, see attached file.
> What do you mean by ' dependent point, .. a point whose coordinates are
> computed by the block of code'?
> How do I _continuously_ while the point on the x-axis is dragged display
> the y-coordinate of the pen?
> Hannes
>
> On Thu, Dec 28, 2023 at 2:08 PM Hilaire Fernandes <hfern@free.fr> wrote:
>
> > Hi Hannes,
> >
> > The y-value does not exist. It is not needed to plot the curve. Indeed,
> > the plot is based on the geometric locus, it depends on a mobile point on a
> > line and dependent point, here a point whose coordinates are computed by
> > the block of code.
> >
> > See its implementation in the ckass DrGeoSketch. It is a kind of user side
> > implementation, not part of the core Dr. Geo model:
> >
> > 1
> > 2
> > 3
> > 4
> > 5
> > 6
> > 7
> > 8
> >
> > plot: f from: x0 to: x1| mobile s pen|
> >     s := self segment: x0@0 to: x1@0.
> >     mobile := self pointOnLine: s at: 0.
> >     pen := self
> >             point: [:item | item point x @ (f value: item point x)]
> >             parent: mobile.
> >     ^ (self locusOf: pen when: mobile) color: Color blue
> >
> >
> > To compute by yourself the y-value, you will need the method above to
> > return the pen point as-well.
> > You can edit it so it returns a 2-array with both the locus and the pen.
> >
> > Hilaire
> >
> >
> > Le 28/12/2023 à 13:09, H. Hirzel a écrit :
> >
> > Hi Hilaire
> >
> > I have the following code
> >
> > | sketch f |
> > sketch := DrGeoSketch new axesOn gridOn.
> > f := [ :x | 0.2 * x * x - 1].
> > sketch plot: f from: -6 to: 6.
> >
> > If I execute it I get two points without names.
> > One on the x-axis and one on the graph.
> >
> > The point on the x-axis may be dragged to the right and the point on the
> > graph follows.
> > How make the y-value of the point on the diagram appear?
> >
> > --
> > GNU Dr. Geohttp://gnu.org/s/dr-geo/http://gnu-drgeo.blogspot.com/
> >
> >

```