Math.cos uses radians instead of degrees...
Multiply by 0.01745329251994 to convert.
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++;
}
desired.jpgTitle | # Comments | Views | Activity |
---|---|---|---|
Unable to open debugger port in Intellij idea | 6 | 88 | |
Energy conservation - Edward Leedskalnin | 20 | 75 | |
bitbucket vs gitbucket | 3 | 34 | |
Calculating Probability | 18 | 65 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!