Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6657727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:48:21+00:00 2026-05-26T01:48:21+00:00

iPhone SDK and Objective-C Goal: I’m trying to calculate the ‘x’ and ‘y’ coordinates

  • 0

iPhone SDK and Objective-C

Goal:

I’m trying to calculate the ‘x’ and ‘y’ coordinates of 2 circles. I have the inner circle dimensions and want to calculate what the ‘x’ and ‘y’ coordinates of the larger outer circle circumference would be to match the same width (distance) along the edge of the larger circle as it does with the inner circle.

In the end, I just need to figure out what the edge x/y points would be for the large circles edge. So that it matches the same as the inner smaller circle. If the width is 10 high on the inner circle, I need to know the x/y points to make it 10 high to the larger circle. To make a rectangle that will extend. Perpendicular lines.

Example:

I’m using the following to calculate the first 2 sets of x/y for the arc on the inner circle to plot points:

- (CGPoint)coordinatePoints:(CGFloat)radius angleDegrees:(CGFloat)degrees xAxis:(CGFloat)x yAxis:(CGFloat)y {
    CGFloat pointX = (CGFloat) ((radius * cos((degrees * M_PI) / 180.0f)) + x);
    CGFloat pointY = (CGFloat) ((radius * sin((degrees * M_PI) / 180.0f)) + y);
    CGPoint points = CGPointMake(pointX, pointY);

    return points;
}

I call it for the first 2 positions on the inner circle. I need to figure out how to make it have the distance on the outer circle as well.

CGPoint innerPoints1 = [self coordinatePoints:innerRadius angleDegrees:startingPoint xAxis:x yAxis:y];
CGPoint innerPoints2 = [self coordinatePoints:innerRadius angleDegrees:endingPoint xAxis:x yAxis:y];

If the inner circle radius is 200, and the outer circle radius is 500, I want it to still be the same thickness from the inner circle to the larger outer circle when I plot the points.

// I have these calculated.
CGContextMoveToPoint(context, innerPoints1.x, innerPoints1.y);
CGContextAddLineToPoint(context, innerPoints2.x, innerPoints2.y);

// I need to find the solution for making innerPoints3 and innerPoints4 correctly.
CGContextAddLineToPoint(context, innerPoints3.x, innerPoints3.y);
CGContextAddLineToPoint(context, innerPoints4.x, innerPoints4.y);

I have the coordinates for the inner circle lines for spaced out x/y points. I need to find the proper way to get the same width plotted for the larger circle locations. Circle sizes will always change. Lengths of the lines will be dynamic. As I’m trying to create a polygon, I need to find 2 coordinates on the larger circles, for each segment.

Any help with this would be greatly appreciated.

Information graphics: a comprehensive illustrated reference
Page 74: In the section “Circular Column Graph”, my end goal is to be able to produce the same result as displayed in the 3 images.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:48:21+00:00Added an answer on May 26, 2026 at 1:48 am

    If the spokes are not too thick, then the arc length is a good approximation of the spoke width:

    So first you construct your 2 inner points, with 2 angles (a1 and a2) centered around a main spoke angle (a).
    Then you calculate the distance D between these points (or you approximate it by R1*(a2-a1))

    Then you take the points on the outer circle with angle values centered around the same main spoke angle: a-0.5*D/R2 and a+0.5*D/R2. These points will be D apart (measured on the arc)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to the whole iPhone SDK and objective C, but have managed
I'm relatively new to objective-c...I'm using the iphone 3.0 SDK I have a UIView,
I'm using objective-c & the iphone 3.0 sdk I want to retrieve the contents
I am new to Objective C and the iPhone SDK, and am trying to
I'm new to Objective-C and iPhone SDK development. I want to call a method
This is an Objective-C/iphone SDK question. I have a dashboard view that is used
I'm trying to learn Objective-C/iPhone SDK and right now I'm doing a kind of
I have just started learning objective-C and the iphone sdk and I have a
I am a novice using iPhone SDK and Objective C. I am facing a
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.