Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Requested: Kompass function vb6

2 views
Skip to first unread message

Leo van der Kallen

unread,
Jun 17, 2007, 7:22:47 AM6/17/07
to
Hello,

Can someone help me to make a subroutine for a visual kompass.

Need a sub where i put in the degrees (0-359) and the result is a kompas for
example in a picturebox with the arrow pointing the right direction.
I get the degrees from a GPS unit where i made an application for, witch i
want to extend with a kompass display

Tried to make a picturebox with making lines from the middel, but i get
stuck on the calculation of transferring the degrees to the right
coordinates in the picturebox.

for example when the picturebox is 2000 by 2000 twips

Then a kompass line in the East direction 90 degrees is the line:
P1.DrawWidth = 2
P1.Circle (1000, 1000), 980, vbGreen ' Circle
P1.DrawWidth = 10
P1.Line (1000, 1000)-(2000, 1000), vbRed ' Direction line

And a kompass line from 135 degrees is (South-East)
P1.DrawWidth = 2
P1.Circle (1000, 1000), 980, vbGreen ' Circle
P1.DrawWidth = 10
P1.Line (1000, 1000)-(2000, 2000), vbRed ' Direction


Hope someone can help me.

Leo


Michael Cole

unread,
Jun 17, 2007, 7:45:07 PM6/17/07
to
Leo van der Kallen wrote:
> Hello,

Firstly, you have posted to quite a few newsgroups and many of them are
inappropriate.

> Can someone help me to make a subroutine for a visual kompass.
>
> Need a sub where i put in the degrees (0-359) and the result is a
> kompas for example in a picturebox with the arrow pointing the right
> direction.

This is pretty much basic trigenometry, and VB6 does include Sin and Cos
functions. Just remember that the VB6 functions work in Radians, so multipy
your degrees by 2*Pi and divide by 360 first.

Post back if you have any specific issues.

--
Regards,

Michael Cole


MikeD

unread,
Jun 17, 2007, 10:02:15 PM6/17/07
to

"Michael Cole" <no...@microsoft.com.au> wrote in message
news:uKB0MmTs...@TK2MSFTNGP05.phx.gbl...

> Leo van der Kallen wrote:
>> Hello,
>
> Firstly, you have posted to quite a few newsgroups and many of them are
> inappropriate.
>

Worse (IMO), he posted to groups from different servers.
"basicworld.public.vb.tools" is not a newsgroup on MS's news server. Chances
are, he's accessing newsgroups via his own ISP's news server and doesn't
know (much less easily see) that the groups are actually mirrored from
different "source" servers. But, those of us that access MS newsgroups
directly from MS's news server can't even post to this
"basicworld.public.vb.tools" group.

--
Mike
Microsoft MVP Visual Basic


0 new messages