Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!jarthur!nntp-server.caltech.edu!juliet.caltech.edu!gceych From: gceych@juliet.caltech.edu (Eychaner, Glenn C.) Newsgroups: comp.lang.c Subject: ATAN2 and HYPOT functions for ints... Message-ID: <1990Dec18.015344.19706@nntp-server.caltech.edu> Date: 18 Dec 90 01:46:44 GMT Sender: news@nntp-server.caltech.edu Reply-To: gceych@juliet.caltech.edu Organization: California Institute of Technology Lines: 16 News-Software: VAX/VMS VNEWS 1.3-4x Nntp-Posting-Host: juliet.caltech.edu Ok, so here's my problem. I am dividing two 512x512 arrays of unsigned char into 8x8 boxes, summing over the boxes, and then shoving the results from the two arrays through atan2() and hypot(). The problem is: these function are awfully slow, as I have to convert int (the result of the summing) to float, and then convert the result back to int (unsigned char, actually). Anyone got a faster way to do this? No, LUTs, BTW, the "summing" has some added complications I won't mention which increases the range of the numbers involved... In other words, anyone got a hypot() or atan2() function which take and return int? (Note: atan2 should return a number in degrees if it returns int...) Just wondering... Glenn Glenn Eychaner |Eychaner@SunCub.Caltech.edu |Remember: It is easier to ride a 40386 N Shore Ln |gceych@iago.caltech.edu |camel through the eye of a needle Big Bear City, CA| Big Bear Solar Observatory |than to drive a Buick through the 92314| !*** G O N I N E R S ***! |hole in a doughnut.