comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: TRIANGULATE says "Points are co-linear, no solution"
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: TRIANGULATE says "Points are co-linear, no solution" [message #17732] Fri, 12 November 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Jonathan Joseph (jj@scorpio.tn.cornell.edu) writes:

> Anyway, I *AM* running idl 5.2 (well, 5,2,1), so presumably,
> I should not have this problem. I have created an IDL save file
> now at the same place ftp://scorpio.tn.cornell.edu/jj/idl/
> The file is called test.sav
>
> The following code should work:
> And by that, I mean (not work).
> At least, it causes the error listed below on my
> system (IDL 5.2.1 running on HP-UX 10.20)
>
> ;; restore the data
> IDL> restore,'test.sav'
> ;; create a window
> IDL> window
> ;; plot the data to see that it looks reasonable
> IDL> plot,x,y,psym=3
> ;; try to triangulate the points
> IDL> triangulate,x,y,tr,b
> % TRIANGULATE: Points are co-linear, no solution.

Ah, so much better. :-)

For what it is worth, the TRIANGULATE command works
perfectly on my Windows NT machine running IDL 5.2.1.
Could this be an HP thing?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: TRIANGULATE says "Points are co-linear, no solution" [message #17735 is a reply to message #17732] Fri, 12 November 1999 00:00 Go to previous message
Jonathan Joseph is currently offline  Jonathan Joseph
Messages: 69
Registered: September 1998
Member
Sorry about the IDL code mixup, some cut/paste
problems - and the fact that I changed variable names from
from xx and yy to x and y (after pasting) but forgot to change
them all. In other words, I noticed that in the code I supplied
that the readu command was missing the "y" at the end of it, and
the plot command was plotting xx and yy instead of x and y
(and probably shouldn't have had the /device on it). And
I left off the "close, unit" command to
clean up the open file unit - though that shouldn't
have mattered. Sorry, I was in a rush and can only
plead incompetancy.

Anyway, I *AM* running idl 5.2 (well, 5,2,1), so presumably,
I should not have this problem. I have created an IDL save file
now at the same place ftp://scorpio.tn.cornell.edu/jj/idl/
The file is called test.sav

The following code should work:
And by that, I mean (not work).
At least, it causes the error listed below on my
system (IDL 5.2.1 running on HP-UX 10.20)

;; restore the data
IDL> restore,'test.sav'
;; create a window
IDL> window
;; plot the data to see that it looks reasonable
IDL> plot,x,y,psym=3
;; try to triangulate the points
IDL> triangulate,x,y,tr,b
% TRIANGULATE: Points are co-linear, no solution.

I have tried the jitter business before to good effect.
I guess I'll go that route for now, I just didn't want to
accidentally jitter it too much and get "negative triangles"
when I applied the triangulation to the real positions.

As for what the data is... Well, it has something to do
with stereo offsets between images. The interesting coastline
effect is due to certain (dark) areas of the images are
not being processed - and there is also a polygonal clipping region
applied. The actual images are of asteroid 253 Mathilde.

And I apologize for the ranting - I was a bit over the
edge yesterday afternoon.

-Jonathan
Re: TRIANGULATE says "Points are co-linear, no solution" [message #17747 is a reply to message #17732] Thu, 11 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:

> Also, your transcript of the IDL session didn't seem to add up. I
> understood how to fix it, but it wasn't ready to run. Doing these
> things will encourage the user community to help you. Dammit. :-)

Yeah, I tried for 10 minutes and didn't get *anywhere*.
That's about the limit of my patience. Good thing
Craig was reading. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: TRIANGULATE says "Points are co-linear, no solution" [message #17750 is a reply to message #17747] Thu, 11 November 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Jonathan Joseph <jj@scorpio.tn.cornell.edu> writes:
>
> TRIANGULATE says "Points are co-linear, no solution"
>

You didn't say what version of IDL you were running, but my guess is
IDL 5.0. When I try it on a few different versions I get the
following results:

IDL 5.0 fails
IDL 5.1 succeeds
IDL 5.2 succeeds, etc...

> Is the IDL triangulate code just really weak?

The answer is, triangulate *was* weak, but improved in later versions.
However, I think the following fudge will work for what you need, even
under IDL 5.0.

x1 = x + randomn(seed, 9853) * 0.0001
y1 = y + randomn(seed, 9853) * 0.0001
triangulate,x1,y1,tr,b

Adding a random component disturbs the points just enough so they are
non co-linear, but below your precision level.

Now in return, and to satisfy my curiosity, you have to describe what
your data represents... some coastal area? What are you doing with
it? Buried treasure? New shipping lanes?

Craig

P.S. You could have avoid the byte-ordering problems (which I *did*
have on an Intel machine) by posting an IDL "save" file. That solves
the byte ordering problem and makes it easier to read in for others.

Also, your transcript of the IDL session didn't seem to add up. I
understood how to fix it, but it wasn't ready to run. Doing these
things will encourage the user community to help you. Dammit. :-)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Object style guide
Next Topic: Re: Alpha/UNIX rehosting question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:52:30 PDT 2025

Total time taken to generate the page: 0.00675 seconds