How do I use the #angle:to: method?

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

How do I use the #angle:to: method?

HJH
This post was updated on .
Hello Hilaire


The method #angle:to: is implemented as


  angle: wrpVect1 to: wrpVect2
        self preProcessing.
        ^ self
                finalizeValue: (DrGAngleVectorsItem newWith: {
                        (self wrappedVector: wrpVect1) mathItem.
                        (self wrappedVector: wrpVect2) mathItem.
                        self aPosition})
                hide: false

It takes to wrapped vectors as argument.

Can I use a ray as the vector?

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

    pointA := 1@0.
    pointB := 5@0.
    pointC := 5@5.
    ray1 :=  c ray: pointA to: pointB.
    ray2 := c ray: pointA to: pointC.

    c angle: ray1 to: ray2
 
--Hannes
Reply | Threaded
Open this post in threaded view
|

Re: How do I use the #angle:to: method?

Hilaire Fernandes
Administrator
Le 01/10/2018 à 14:08, HJH [via Dr. Geo Forum] a écrit :


The method #angle:to: is implemented as


  angle: wrpVect1 to: wrpVect2
        self preProcessing.
        ^ self
                finalizeValue: (DrGAngleVectorsItem newWith: {
                        (self wrappedVector: wrpVect1) mathItem.
                        (self wrappedVector: wrpVect2) mathItem.
                        self aPosition})
                hide: false

It takes to wrapped vectors as argument.

Can I use a ray as the vector?


No you can't. Dr. Geo should be extended to allow that.

https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#index-angle_003ato_003a-on-DrGeoCanvas

Now at the user level it should be possible to extend the DrGeoCanvas class to allow that (underneath vector will still be needed of course and created based on the ray argument).

Hey it is Smalltalk land.

Hilaire



Was this message helpful?
Tell us!