# trace a point on the circumference of a circle that

Page 1 of 1

## 6 Replies - 5478 Views - Last Post: 30 August 2009 - 08:37 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=123016&amp;s=8fb6ce2322dee83c63ecc5efca933ae1&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 wartech

• D.I.C Head

Reputation: 10
• Posts: 203
• Joined: 16-October 06

# trace a point on the circumference of a circle that

Posted 30 August 2009 - 06:05 PM

Hello Everyone,

I am working on a problem in java where I need to trace a point on the circumference of a circle that rotates around a point on the circumference of another circle.
I started by making sure I could get a circle first but did not know how to proceed from there. I just need a clearer understanding of what is being asked.

This is what I was thinking:
1) Draw the first circle
2) Pick any point within the first circle
3) Draw all circles based on that same point

Is this the correct logic? Your help is appreciated.

Thanks,

Is This A Good Question/Topic? 0

## Replies To: trace a point on the circumference of a circle that

### #2 pbl

• There is nothing you can't do with a JTable

Reputation: 8378
• Posts: 31,956
• Joined: 06-March 08

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 06:48 PM

After 159 posts you should know the rules (or you have a serious problem )

[rules][/rules]
Was This Post Helpful? 0

### #3 wartech

• D.I.C Head

Reputation: 10
• Posts: 203
• Joined: 16-October 06

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 07:11 PM

Yeah, I am familiar with the policies. Anyhow I was trying to avoid posting code because it is a homework project. I was not clear what the question was asking. I was simply wondering if I was on the right track. Again I just don't know how to go about tracing a point on the circumference of a circle that rotates around a point on the circumference of another circle. In my first post I explained what I was thinking needed to be done. I am not asking for anyone to write the code for me. Just a clearer understanding of what is being asked. Thanks.

Here is the code for the full circle:

```private static void drawCircle()
{
double radius = 50;
double theta = 0;
double radians;
double deltaX;
double deltaY;

Display circle = new Display(350,6);

for (int i = 0; i < 360; i++)
{
radians = toRadians(theta);
deltaX =  radius * cos(radians);
deltaY = radius * sin(radians);
circle.drawNextPixel((int)(200 + radius + deltaX), (200 + (int)deltaY));
theta++;
}
}
private static double toRadians(double theta)
{
return(Math.toRadians(theta));
}
private static double cos(double a)
{
return (Math.cos(a));
}
private static double sin(double a)
{
return (Math.sin(a));
}
//	private static double Circumference(double radius)
//	{
//		return (Math.PI * 2 * radius);
//	}

```

Was This Post Helpful? 0

### #4 pbl

• There is nothing you can't do with a JTable

Reputation: 8378
• Posts: 31,956
• Joined: 06-March 08

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 07:19 PM

wartech, on 30 Aug, 2009 - 06:11 PM, said:

Anyhow I was trying to avoid posting code because it is a homework project.

And you are leaving in a country like Albania where posting code is illegal ?

Seriously don't you think that

radians = toRadians(theta);

should be

radians = toRadians(i);
Was This Post Helpful? 0

### #5 wartech

• D.I.C Head

Reputation: 10
• Posts: 203
• Joined: 16-October 06

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 07:23 PM

You gotta be kidding me...I was just asking for some help here. Whatever man, I'll ask elsewhere.
Was This Post Helpful? 0

### #6 pbl

• There is nothing you can't do with a JTable

Reputation: 8378
• Posts: 31,956
• Joined: 06-March 08

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 07:25 PM

wartech, on 30 Aug, 2009 - 06:23 PM, said:

You gotta be kidding me...I was just asking for some help here. Whatever man, I'll ask elsewhere.

I think you haven't read the second part of my reply
You want to check on an Albanian site ?

See how posting code fix a lot of problems

This post has been edited by pbl: 30 August 2009 - 07:29 PM

Was This Post Helpful? 1

### #7 LynnL

• D.I.C Head

Reputation: 21
• Posts: 109
• Joined: 13-April 09

## Re: trace a point on the circumference of a circle that

Posted 30 August 2009 - 08:37 PM

wartech, on 30 Aug, 2009 - 06:23 PM, said:

You gotta be kidding me...I was just asking for some help here. Whatever man, I'll ask elsewhere.

Any sense of humour ?
Was This Post Helpful? 1

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }