Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dashboard effect in Java application



the following code

int n = 100000;
long start = System.currentTimeMillis();
double k = Math.PI/180;
for(int i = 0; i < n; i++){
double angle = 180*Math.random();
double cosa = Math.cos(angle*k);
double sina = Math.sin(angle*k);
double arccosa = Math.acos(cosa);
}
long end = System.currentTimeMillis();
System.out.println("per cycle "+(double)(end-start)/(double)n);


reports about 0.003

that means that that time is really much less than painting time
so using lookup tables for trig functions won't give any significant gain in performance


thanks

On Dec 21, 2004, at 10:56 PM, Tom Davies wrote:

I meant a lookup table of the results of evaluating trigonometrical
functions like sin and cos

Tom

On Tue, 21 Dec 2004 22:52:26 -0500, Dmitry Markman <email@hidden> wrote:
I'm not very familiar with image's lookup tables
but I thought it's related to the color conversion
cube transition has nothing to do with color conversion

or maybe you mentioned other lookuptable
so I didn't get it again :-(

thanks


On Dec 21, 2004, at 4:38 PM, Tom Davies wrote:

On Tue, 21 Dec 2004 16:10:34 -0500, Dmitry Markman <email@hidden>
wrote:

On Dec 21, 2004, at 3:19 PM, Levi Yourchuck wrote:

A couple of points on :

Have you considered putting in a table for the trig functions?
if I understand right your question: you can trigger the changing by
clicking right bottom corner of the table

I'm pretty sure Levi meant a precomputed look-up table.

Tom

--
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Dmitry Markman




--
email@hidden


Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Dashboard effect in Java application (From: Tom Davies <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.