I'm having a problem seperating the circle into segments. I'm wanting to draw a line every 3.6 degrees. Or even better draw from 0 on left to 100 on right (image 1) with appropriate 100 segment degrees inbetween.

My problem is that when I set theta to different values in my code (attached) I get different angles drawn!

Code at the moment draws all the lines on top of each other as this was how I noticed that it was drawing the lines at the correct degree segments!

Any suggestions on whats going on here? Or perhaps how once overcome this problem how I can start to work out my desired result!

p.s. Sorry if in wrong area!

Thanks
James

int iCurrentRowStart = 0; for (int x = 0; x < m_data.header.iNeuron; x++) { for (int y = iCurrentRowStart; y < m_data.header.iNeuron; y++) { if (x != y) { double iIncrease = 3.6; //360 / m_data.header.iWin; for (int i = 0; i < m_data.header.iWin; i++) { double dTheta = 180; //(iIncrease * i) + 8; // work out beggning of line on outside of inner circle double xPos1 = m_pStartX + (m_iMiddle * Math.cos(dTheta)); double yPos1 = m_pStartY + (m_iMiddle * Math.sin(dTheta)); // work out end of line on outside of outer circle double xPos2 = xPos1 + ((m_data.afNorm[x][y][i]*m_iScale)) * Math.cos(dTheta); double yPos2 = yPos1 + ((m_data.afNorm[x][y][i]*m_iScale)) * Math.sin(dTheta); if (m_data.afNorm[x][y][i] == m_data.afPeaks[x][y]) { if (i >= 50){ gIn.setColor(Color.RED); } else { gIn.setColor(Color.BLUE); } } else { gIn.setColor(Color.BLACK); } gIn.draw(new Line2D.Double(xPos1, yPos1, xPos2, yPos2)); } } } iCurrentRowStart++; }

It is very important that these are very accurate so they can be exactly on top of each other. Would it be possible to do what i'm wanting in radians or is the above going to be accurate?

Radians are a bit rusty for me - 2(pie) in a circle, so I could divide that by 100 still!?

Did you get this working ? Because the accepted replies are not very accurate.

The lower limit should be -PI/4 and not -PI/2.
The step size should be calculated by dividing by the number of steps (100), not multiplying.
The step size should be negative because you're going clockwise.

Yeh, I resorted to the multiple by pi/180 although figured out the others with some common sense and tweaking :)

0

Featured Post

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.

Introduction
This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…

Viewers will learn about the regular for loop in Java and how to use it.
Definition:
Break the for loop down into 3 parts:
Syntax when using for loops:
Example using a for loop:

I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.
https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt
https://filedb.experts-exchange.com/incoming/201…