Title: Problem with co-ordinates... Help please ???

All,

I am using the following snippets of code to create fixed width band regions at 90 degrees to a series of given straight lines. The lines contain numerical data which I can then thematically map. I also have a version that creates variable width bands but for the moment I'll assume all bands are the same width.

After a lot of tweaking I thought I had finished the tool...Unfortunately, after crudely holding the corner of a sheet of paper up to the screen it appears my bands aren't perfectly perpendicular to the original line though I am clueless as to what could have gone wrong…

Is there any error converting degrees to radians and then back again in MapInfo ? Also, I am the using British national grid co-ordinate set, could this where my slight discrepancy has come from multiplying ?

    fFNodeX = ObjectNodeX(oLine, 1, 1) ' read longitude
    fFNodeY = ObjectNodeY(oLine, 1, 1) ' read latitude
    fTNodeX = ObjectNodeX(oLine, 1, k) ' read longitude
    fTNodeY = ObjectNodeY(oLine, 1, k) ' read latitude

    fA1 = fTNodeX - fFNodeX
    fA2 = fTNodeY - fFNodeY
    fLinkLength = SQR(fA1*fA1 + fA2*fA2)
    fB1 = -fA2/fLinkLength
    fB2 = fA1/fLinkLength

    x1 = fFNodeX + (fB1 *(fWidth + fOffset))
    y1 = fFNodeY + (fB2 *(fWidth + fOffset))
    x2 = fTNodeX + (fB1 *(fWidth + fOffset))
    y2 = fTNodeY + (fB2 *(fWidth + fOffset))
    x3 = fTNodeX + (fB1 * fOffset)
    y3 = fTNodeY + (fB2 * fOffset)
    x4 = fFNodeX + (fB1 * fOffset)
    y4 = fFNodeY + (fB2 * fOffset)

As always, any help would be greatly appreciated…

Many thanks

Stu



 

 

Visit our website at http://www.halcrow.com

------------------------------------------------------------------------
The contents of this email are confidential, for the sole use
of the intended recipient at the email address to which it has
been addressed and do not give rise to any binding legal
obligation upon Halcrow companies unless subsequently confirmed
on headed business notepaper sent by fax, letter or as an email
attachment.  Whilst reasonable care has been taken to avoid virus
transmission, no responsibility for viruses is taken and it is
your responsibility to carry out such checks as you feel
appropriate.  Emails supplied are as found and there's no
guarantee that the messages contained within the body of the
email have not been edited after receipt. If you receive this
email in error, please contact the sender immediately and delete
the message from your system.
Thank you.
-------------------------------------------------------------------------

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to