Wrox Programmer Forums
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2004, 01:08 PM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default Spiral Sketcher

Hello again,

writing a spiral sketcher from scratch was quite a challenge, but I did it. My first serious Java Applet!

http://spiral.novaloka.nl/SpiraTron.html

Congratulations?

For the mathematicians in the audience:
The spiral 'angle' is the angle the tangent makes with the radius vector. This defines a logarithmic spiral.

The formula I used:
theta = log(radius) * tan(angle*PI/180);

For the programmers:
I used a JSlider to control the spiral angle. JSlider is a strange beast..
The spiral is in reality a GeneralPath consisting of 250 to 1000 lines from point to point. The spiral is painted in XORMode.

freezotic
www.novaloka.nl





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sketcher Applet Problems gerrymurphy BOOK: Beginning Java 2 9 December 14th, 2004 10:49 AM
Sketcher Full Source JCScoobyRS BOOK: Beginning Java 2 0 November 17th, 2003 03:18 PM
Sketcher Source JCScoobyRS Java GUI 1 November 17th, 2003 03:17 PM
drawing in java: sketcher koekke JSP Basics 0 October 25th, 2003 11:46 AM
sketcher koekke Wrox Book Feedback 1 October 20th, 2003 09:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.