Discussion forum for the BasicX family of microcontroller chips.
COS SIN Operation - patgadget - Sep 26 9:31:45 2007
Hy,
I would like to interface a GPS on a Basicx chip but needs a lot of
precision on the SIN and COS operation
For example sin(45.0001 deg)
is this something that this chip supports???
I know the Basic Stamp (parallax) does not support that well
I would like to know before i buy
Thanks
Pat

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: COS SIN Operation - rosa...@aol.com - Sep 26 15:35:35 2007
Hi,
Check the basic express language reference manual page 17.
It's explain BX24 data types. Floating point variables are 32 bits long.
Single 32 bits??? -3.402 823 E+38 .. 3.402 823 E+38
?
rosarite
-----Original Message-----
From: patgadget
To: b...@yahoogroups.com
Sent: Tue, 25 Sep 2007 5:20 pm
Subject: [BasicX] COS SIN Operation
Hy,
I would like to interface a GPS on a Basicx chip but needs a lot of
precision on the SIN and COS operation
For example sin(45.0001 deg)
is this something that this chip supports???
I know the Basic Stamp (parallax) does not support that well
I would like to know before i buy
Thanks
Pat
________________________________________________________________________
Email and AIM finally together. You've gotta check out free AOL Mail! -
http://mail.aol.com
[Non-text portions of this message have been removed]

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: COS SIN Operation - patgadget - Sep 26 17:44:04 2007
Thanks i saw that, but it does not explaine how the SIN and COS value
are calculated, are they in single?? or as per Basic stamp, integer?
Thanks in advance
Pat
--- In b...@yahoogroups.com, rosarite@... wrote:
> Hi,
>
> Check the basic express language reference manual page 17.
> It's explain BX24 data types. Floating point variables are 32 bits
long.
>
> Single 32 bits??? -3.402 823 E+38 .. 3.402 823 E+38
> ?
>
> rosarite
>
>
> -----Original Message-----
> From: patgadget
> To: b...@yahoogroups.com
> Sent: Tue, 25 Sep 2007 5:20 pm
> Subject: [BasicX] COS SIN Operation
>
>
>
>
>
> Hy,
>
> I would like to interface a GPS on a Basicx chip but needs a lot of
>
> precision on the SIN and COS operation
>
> For example sin(45.0001 deg)
>
> is this something that this chip supports???
>
> I know the Basic Stamp (parallax) does not support that well
>
> I would like to know before i buy
>
> Thanks
>
> Pat
>
>
>
>
>
>
>
>
______________________________________________________________________
__
> Email and AIM finally together. You've gotta check out free AOL
Mail! - http://mail.aol.com
> [Non-text portions of this message have been removed]
>

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: Re: COS SIN Operation - rosa...@aol.com - Sep 27 5:09:39 2007
Hi,
It is a single variable or floating point.
The reason I use BX24 is because the floating point. Sometime you need
accuracy that you do not have in fixed variable.
rosarite
************************************** See what's new at http://www.aol.com
[Non-text portions of this message have been removed]

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: COS SIN Operation - Tom Becker - Sep 27 17:20:38 2007
> ... interface a GPS [with] precision [] For example sin(45.0001 deg)...
Yes, BasicX will probably be able to solve your need.
BasicX trig functions use and produce 32-bit floating-point values;
such a variable's data type is Single. A single provides the
equivalent of about 7.5 decimal digits of significance or precision.
If you convert a GPS-provided latitude or longitude in degrees and
minutes (e.g. "15201.5261,W" = -152.025435 degrees) to a 32-bit
floating-point single value you'll lose some resolution. At my
location, this means that I cannot express a longitude more accurately
than about 10 feet, despite having GPS data that is probably accurate
to one foot.
In practice, 32-bit-float lat/longs are adequate for many applications
but, if you need the best possible preservation of GPS position data,
you will need more resolution than a 32-bit float provides - but not
much more, so some gimmickry in your data handling will probably be
sufficient.
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )
Re: COS SIN Operation - tohnitan - Sep 27 19:21:43 2007
Hi, Tom:
Please explain what you mean writing that "some gimmickry in your
data handling will probably be sufficient" (particularly, for
handling the GPS data processing). How to increase precision and
accuracy of the single 32-bit data calculations over "7.5 decimal
digits"? Please share these gimmicks with us!
Thanks,
Tohnitan
--- In b...@yahoogroups.com, "Tom Becker"
wrote:
>
> > ... interface a GPS [with] precision [] For example sin(45.0001
deg)...
>
> Yes, BasicX will probably be able to solve your need.
>
> BasicX trig functions use and produce 32-bit floating-point values;
> such a variable's data type is Single. A single provides the
> equivalent of about 7.5 decimal digits of significance or
precision.
> If you convert a GPS-provided latitude or longitude in degrees and
> minutes (e.g. "15201.5261,W" = -152.025435 degrees) to a 32-bit
> floating-point single value you'll lose some resolution. At my
> location, this means that I cannot express a longitude more
accurately
> than about 10 feet, despite having GPS data that is probably
accurate
> to one foot.
>
> In practice, 32-bit-float lat/longs are adequate for many
applications
> but, if you need the best possible preservation of GPS position
data,
> you will need more resolution than a 32-bit float provides - but
not
> much more, so some gimmickry in your data handling will probably be
> sufficient.
> Tom
>

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: COS SIN Operation - patgadget - Sep 28 7:06:34 2007
--- In b...@yahoogroups.com, "Tom Becker"
wrote:
>
> > ... interface a GPS [with] precision [] For example sin(45.0001
deg)...
>
> Yes, BasicX will probably be able to solve your need.
>
> BasicX trig functions use and produce 32-bit floating-point values;
> such a variable's data type is Single. A single provides the
> equivalent of about 7.5 decimal digits of significance or precision.
> If you convert a GPS-provided latitude or longitude in degrees and
> minutes (e.g. "15201.5261,W" = -152.025435 degrees) to a 32-bit
> floating-point single value you'll lose some resolution. At my
> location, this means that I cannot express a longitude more accurately
> than about 10 feet, despite having GPS data that is probably accurate
> to one foot.
>
> In practice, 32-bit-float lat/longs are adequate for many applications
> but, if you need the best possible preservation of GPS position data,
> you will need more resolution than a 32-bit float provides - but not
> much more, so some gimmickry in your data handling will probably be
> sufficient.
> Tom
>
Thanks a lot,
I will proceed with ordering then!
Pat

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: COS SIN Operation - vfraenc1 - Sep 28 11:36:35 2007
--- In b...@yahoogroups.com, "Tom Becker"
wrote:
>
> > ... interface a GPS [with] precision [] For example sin(45.0001
deg)...
>
> Yes, BasicX will probably be able to solve your need.
>
> BasicX trig functions use and produce 32-bit floating-point values;
> such a variable's data type is Single. A single provides the
> equivalent of about 7.5 decimal digits of significance or
precision.
> If you convert a GPS-provided latitude or longitude in degrees and
> minutes (e.g. "15201.5261,W" = -152.025435 degrees) to a 32-bit
> floating-point single value you'll lose some resolution. At my
> location, this means that I cannot express a longitude more
accurately
> than about 10 feet, despite having GPS data that is probably
accurate
> to one foot.
>
> In practice, 32-bit-float lat/longs are adequate for many
applications
> but, if you need the best possible preservation of GPS position
data,
> you will need more resolution than a 32-bit float provides - but
not
> much more, so some gimmickry in your data handling will probably be
> sufficient.
> Tom
>
Tom
Is it possible that the OP could achieve somewhat more precision
using one of MicroMegaCorps uFPUs?
Just a thought.
Vic

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )Re: Re: COS SIN Operation - Tom Becker - Sep 28 13:27:34 2007
> ... more precision using one of MicroMegaCorps uFPUs?
The µM-FPU V3 can directly receive NMEA from a GPS or other source and
parse the $GPRMC sentence position into two pairs of 32-bit floats, one
for integral degrees and one for fractional degrees; together they are
adequate to retain the position resolution available from a consumer
GPS. Basic-X code can do the same.
Whether provided by a µM-FPU or parsed by your own code, if at any point
in your processing you sum those two angle components into a single
32-bit float variable, you again risk resolution loss. To avoid that,
you might find that rescaling the data to a sufficient resolution for
your project will help.
The most compact 32-bit encoding is fixed-point binary. If you consider
the largest terrestrial great circle, like the Equator, and the largest
positive 32-bit signed fixed-point value (7FFFFFFF), you'll find that
the resolution (of longitude at the Equator) is about 20 feet. If
represented as a 32-bit float, the resolution at the Equator is about 50
meters. Here's a useful read:
http://srmwww.gov.bc.ca/gis/storageprecision.html . Read to the bottom.
Tom

(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )