help-octave
[Top][All Lists]
Advanced

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

Re: help drawing a polygon using drawPolygon


From: Doug Stewart
Subject: Re: help drawing a polygon using drawPolygon
Date: Tue, 21 Feb 2017 10:06:01 -0500



On Tue, Feb 21, 2017 at 7:47 AM, Anthony Andriano <address@hidden> wrote:
Hello,

I've been looking at the documentation for a while and I can't figure out what I'm doing wrong. There doesn't seem to be an example to help guide a beginner in this process and the terms aren't exactly clear.

I'm trying to draw a triangle with the coordinates (-1, -2), (0, -2), and (1, -2). The documentation for drawPolygon suggests it can take a list of coordinates or some type of array, but I can't find any examples or explanations for how the data should be entered and nothing I've tried has worked.

drawPolygon(COORD) - what does it mean to 'pack' coords into a single array? How does one accomplish this?

drawPolygon(PX, PY) - how do you specify the coordinates in different arrays? I tried passing in [-1 -2], [0 2], [1 -2] as well as [-1; -2], [0; 2], [1; -2] to no avail.

drawPolygon(POLYS) - I looked up cell arrays, but none of the notation I've tried has worked here.

My goal is to draw a triangle at the given coordinates and then draw it again on the same plot using a different color after applying a linear transformation to rotate it. Any help or guidance anyone can offer would be greatly appreciated.

Thanks,
Tony

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave

 a= [ 1 1 ; 2 3; 4 2]
drawPolygon(a)


px=[-1 2 6 -1]
py=[-3 4 -1 -3]
drawPolygon(px',py')
--
DASCertificate for 206392


reply via email to

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