How do I create a ray with a Smalltalk script?

classic Classic list List threaded Threaded
7 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

How do I create a ray with a Smalltalk script?

HJH
Hello

How do I create a ray with a Smalltalk script

The manual at does not yet give an example how to do that

https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-script.html#Line_002c-ray_002c-segment_002c-vector


--Hannes
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

Hilaire Fernandes
Administrator
Hi Hannes,

There are two approaches in user programming in DrGeo.

Smalltalk script, to compute a value and plug its result on the canvas
Your link point to the Smalltalk script chapter, but this chapter is obsolete, should be rewritten and I don't like its contents.

Smalltalk sketch, to build with code a sketch. This is what you are looking at, and the right place for the doc is at
https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#Smalltalk-sketch
and precisely:
https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#index-Smalltalk-sketch_002c-ray

You can discover more from the index, under the "Smalltalk sketch" index.

Hilaire


Le 13/09/2018 à 13:30, HJH [via Dr. Geo Forum] a écrit :
Hello

How do I create a ray with a Smalltalk script

The manual at does not yet give an example how to do that

https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-script.html#Line_002c-ray_002c-segment_002c-vector


--Hannes


Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

Hilaire Fernandes
Administrator
Hannes,

You may find the Method index worth exploring too:

https://www.gnu.org/software/dr-geo/doc/en/Index.html#Method-index

Hilaire

Le 13/09/2018 à 14:10, Hilaire Fernandes [via Dr. Geo Forum] a écrit :
You can discover more from the index, under the "Smalltalk sketch" index.


Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

HJH
    | c a b d |
    c := DrGeoCanvas new.
    c gridOn.
    a := c point: 1@0.
    b := c point: 5@0.
    d := c ray: a to: b.


 Ray constructed by Smalltalk code
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

HJH
I wonder how I create a ray given

1. a ray with a point pointA as its origin
2. an angle


 | c pointA pointB |
    c := DrGeoCanvas new.
    pointA := c point: 1@0.
    pointB := c point: 5@0.
    ray := c ray: pointA to: pointB.
    ray2 := c "send a message with parameters ray and an angle"
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

Hilaire Fernandes
Administrator
Le 01/10/2018 à 20:52, HJH [via Dr. Geo Forum] a écrit :
I wonder how I create a ray given

1. a ray with a point pointA as its origin
2. an angle


 | c pointA pointB |
    c := DrGeoCanvas new.
    pointA := c point: 1@0.
    pointB := c point: 5@0.
    ray := c ray: pointA to: pointB.
    ray2 := c "send a message with parameters ray and an angle"

I don't understand the logic you have underneath to build ray2 given ray and angle.

If you can explain I can look at it.

Hilaire

Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How do I create a ray with a Smalltalk script

HJH
Clarification: See new topic

'How do I create a 2nd ray with a script given I have a ray and an angle'