HP Forums

Full Version: Geometry App, Distance, Intersections
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This post is based on the thread “find distance between intersections of circle and line”
This seemed like a nice thing to solve with the Geometry App.

What I've done;

Symb -> GA line (y = (2 * x + 3))
Symb -> GB circle (((x + 1) ^ 2 + y ^ 2) = 55)
Symb -> GC inter (GA,GB) (command intersections)

The above was well displayed on the Plot page.

Num -> distance (GC) -> Error: Bad Argument

Hey, that's weird that "distance" can't calculate the distance between the two points of GC.
GC has the value [point (val, val), point (val, val)] .... between square brackets, it’s a list.
On the command line: VARS -> App -> Geometry -> GC value also between square brackets.
After I copied the GC value from command line to distance in the Geometry App and deleted the square brackets, distance could calculate the value.

Conclusion; distance cannot calculate the distance between two points calculated with command intersections. Or distance must take into account the fact that the answer is between square brackets, that the answer is a list.
Or am I doing something wrong myself?
That's expected, distance takes two arguments, and you provide one argument (the list of intersection points). You must convert the list to a sequence of arguments, this can be done with op(). For example
distance(op([point(1,2),point(3,4)]))
Parisse, thank you for your answer!
Your explanation is clear, I actually thought that if intersections() calculate two points distance() should be able to understand / calculate.

Too bad that op() is not mentioned in the Catalog (Tim / Cyrille?) You do not know if this command exists!
I will immediately look in the document "Symbolic computing and Mathematics with the calculator HP Prime"
Thanks!
I found the explanation of op() in document "Symbolic algebra and Mathematics with Xcas" under 4.50.11 and in iOS app PocketCAS (Giac/Xcas)
(09-12-2019 04:22 AM)Dirk.nl Wrote: [ -> ]I found the explanation of op() in document "Symbolic algebra and Mathematics with Xcas" under 4.50.11 and in iOS app PocketCAS (Giac/Xcas)

Seems like a useful document, probably for many things like this. Can you share a link to wherever you found it?
Hello rprosperi,

I hope this is the right side:
http://www-fourier.ujf-grenoble.fr/~pari...cascmd_en/

But I found this also in document “Symbolic computation and Mathematics with the calculator HP Prime. Just in the beginning of this document, I think part II, chapter 1 1.5
I believe you can found this document in https://www-fourier.ujf-grenoble.fr/~par...me_cas.pdf

A nice iOS app is PocketCAS
(09-12-2019 01:22 PM)Dirk.nl Wrote: [ -> ]I believe you can found this document in https://www-fourier.ujf-grenoble.fr/~par...me_cas.pdf

Thanks Dirk!
Reference URL's