2011/11/24 mattschinkel <[email protected]>
>
>
> Can you share your table please?
>
> Matt.
Not sure it is of any help, but below is an old jal code I once used.
Did you have a look at Watty's routines before you asked?
Joep
; converteer een meting naar hoek
; meting is geschaald naar 0...255
function arcsine (byte in meting) return byte is
var bit kwadrant2
var byte factor_h, factor
var byte const_h, const_l
if (meting > 127) then
; tweede kwadrant
meting = 255 - meting
kwadrant2 = true
else
kwadrant2 = false
end if
factor_h = 0
if (meting > 112) then
factor = 115
const_h = 0x93 ; 37758
const_l = 0x7E
elsif (meting > 96) then
factor = 117
const_h = 0x94 ; 37978
const_l = 0x5A
elsif (meting > 80) then
factor = 121
const_h = 0x95 ; 38358
const_l = 0xD6
elsif (meting > 64) then
factor = 128
const_h = 0x98 ; 38912
const_l = 0x00
elsif (meting > 48) then
factor = 139
const_h = 0x9A ; 39615
const_l = 0xBF
elsif (meting > 32) then
factor = 159
const_h = 0x9E ; 40567
const_l = 0x77
elsif (meting > 16) then
factor = 199
const_h = 0xA3 ; 41832
const_l = 0x68
else
factor_h = 1 ; factor 463
factor = 0xCF
const_h = 0xB4 ; 46080
const_l = 0x00
end if
multiply_16b(factor_h, factor, 0, meting)
subtract_16b (const_h, const_l, factor_h, factor)
if (kwadrant2) then
const_h = 180 - const_h
end if
return const_h ; 0...180
end function
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.