help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining a "point"


From: Kai Torben Ohlhus
Subject: Re: Defining a "point"
Date: Sun, 29 Dec 2019 12:01:58 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1

On 12/29/19 4:00 AM, sb wrote:
> Yes I installed. But couldn't find createPoint function (or other).
> There are many functions beginning with create (such as createLine)
but not
> for points.
> It seemed to me trivial but to my surprise I didn't find such an object.
> I want to do simple things such as:
> -Creating lines using 2 points (that I should retrieve them from an
external
> file).
> -Finding intersections between lines (there is a function
intersectLines in
> the geometry package for this)
> -Saving points in external files
> -Drawing points
> Etc...
> So to be more precise, I want to:
> Define 4 points, say, p1, p2, p3, p4 (in reality I will need much more
> "couple" of points and they should be stored on an external data file
> somehow)
> Create 2 lines , say, L1 (between p1 and p2) and L2 (between p3 and p4)
> Find the intersection point: p_intersect
> Save all data in external txt file
>
> Thanks
> Shlomo
>

On 12/29/19 5:08 AM, Juan Pablo Carbajal wrote:
>> Yes I installed. But couldn't find createPoint function (or other).
> Point is a 2x1 array, so it is just P = [x y]
> There is no more complexity needed than this, and this is the
> underlying abstraction for point in geometry and matgeom.
> It gets a little bit more abstract for lines because there are several
> way to define them (the same for circles, rays, etc...)
> For polygons it gets back to a simple N-by-2 array, so there is no
> createPolygon (there are some regular and special polygons though).
> 
> Regards
> 


Shlomo, thanks for explaining your intentions.  The following example of
the geometry package should demonstrate how simple your task is to solve
using that package:

https://octave.sourceforge.io/geometry/function/intersectLines.html

HTH,
Kai



reply via email to

[Prev in Thread] Current Thread [Next in Thread]