# Defining a "point" Classic List Threaded 9 messages Open this post in threaded view
|

## Defining a "point"

 Hello, I have a simple question: How do I define a "point" in Octave? Is this like: p1=(1,2)? or p1=point(1,2)? or something else? I want to use them later for creating lines (passing between 2 defined points). How can I do that? Thanks, Shlomo -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Defining a "point"

 On Sat, Dec 28, 2019 at 8:47 AM sb <[hidden email]> wrote:Hello, I have a simple question: How do I define a "point" in Octave? Is this like: p1=(1,2)? or p1=point(1,2)? or something else? I want to use them later for creating lines (passing between 2 defined points). How can I do that? Thanks, Shlomo -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html points =[1 2; 7 1; 8 3]plot(points)-- DAS Open this post in threaded view
|

## Re: Defining a "point"

 Sorry but when I try your suggestion I get lines and not points (using plot()). Is there a point entity in Octave? Like vectors, matrices? Shlomo -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Defining a "point"

 On 12/29/19 12:34 AM, sb wrote: > Sorry but when I try your suggestion I get lines and not points (using > plot()). > Is there a point entity in Octave? > Like vectors, matrices? > > Shlomo > Maybe a slightly modified version of Doug's example is what you want?    points =[1 2; 7 1; 8 3]    plot(points, "marker", "o", "linestyle", "none") You should be more specific about your intentions, otherwise we just can do wild guessing.  Type some pseudocode you wish Octave could execute, for example.  Is it used just for plotting or do you plan some computations on these points? Other ideas are to create a struct with coordinates    p1.x = 1    p1.y = 2 or even a class would be possible    classdef Point      properties      x      y      endproperties    endclassdef Whatever complexity you wish and need. HTH, Kai
Open this post in threaded view
|

## Re: Defining a "point"

 I thought my question was simple and clear: I wanted to know if there is a "ready-to-use" object as "point"? and if yes, how it is created/defined (the syntax)? I understand from your answer, indirectly, that there is not (as you suggest me to create it). What I want to do is: 1/ To create 2 lines based on points (2 points for each of them) and draw them 2/ To find the intersection point 3/ To draw the (intersection) point Shlomo -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Defining a "point"

 Do you know the package geometry? Às 19:00 de 28/12/19, sb escreveu: ```I thought my question was simple and clear: I wanted to know if there is a "ready-to-use" object as "point"? and if yes, how it is created/defined (the syntax)? I understand from your answer, indirectly, that there is not (as you suggest me to create it). What I want to do is: 1/ To create 2 lines based on points (2 points for each of them) and draw them 2/ To find the intersection point 3/ To draw the (intersection) point Shlomo -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html ```
Open this post in threaded view
|

## Re: Defining a "point"

 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 -- Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html