Click here to Skip to main content
14,487,581 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: maths question Pin
Member 115770084-Feb-20 11:59
MemberMember 115770084-Feb-20 11:59 
AnswerRe: maths question Pin
davecasdf4-Feb-20 3:48
Memberdavecasdf4-Feb-20 3:48 
GeneralRe: maths question Pin
Joan M4-Feb-20 21:32
professionalJoan M4-Feb-20 21:32 
GeneralRe: maths question Pin
davecasdf5-Feb-20 4:48
Memberdavecasdf5-Feb-20 4:48 
AnswerRe: maths question Pin
Member 108052214-Feb-20 4:47
MemberMember 108052214-Feb-20 4:47 
GeneralRe: maths question Pin
Member 108052214-Feb-20 4:52
MemberMember 108052214-Feb-20 4:52 
GeneralRe: maths question Pin
Member 108052214-Feb-20 4:57
MemberMember 108052214-Feb-20 4:57 
AnswerRe: maths question Pin
tnich4-Feb-20 7:44
Membertnich4-Feb-20 7:44 
Simple answer: Yes you can find the angle given measurements of the two discs. I will give you some details in a moment.

More complicated answer: If you want an accurate estimate of the angle, you are out of luck. If you only plan to use the cosine of the angle, you can come up with something pretty good.

Let's call theta the angle that the sensor deviates from dead center on the disc(s).
Let y be the distance of the sensor from the center of the disc(s).

You can use the law of cosines to build two equations involving y and theta.

r_1^2 = m_1^2 + y^2 - 2*m_1*y*cos(theta)
r_2^2 = m_2^2 + y^2 - 2*m_2*y*cos(theta)

Solving them gets you

y = sqrt(m_1*m_2 + (m_2*r_1^2 - m_1*r_2^2)/(m_2 - m_1))
cos(theta) = (m_1^2 - r_1^2)/(2*m_1*y) + y/(2*m_1)

The problem with getting a good value for theta is that cos(theta) is going to be very close to 1.0000 for any small value of theta. So even a tiny measurement error will result in a incommensurately large error in theta. And cos(theta) may even come out to be greater than 1, in which case theta is undefined. However, it seems like a good bet that you can get by with just an estimate of cos(theta) for your calibration, since given a measurement m you can use the law of cosines to find the distance from the center.

modified 4-Feb-20 17:02pm.

AnswerRe: maths question Pin
itprorh664-Feb-20 8:36
Memberitprorh664-Feb-20 8:36 
GeneralRe: maths question Pin
Joan M4-Feb-20 10:10
professionalJoan M4-Feb-20 10:10 
GeneralRe: maths question Pin
tnich4-Feb-20 11:03
Membertnich4-Feb-20 11:03 
GeneralRe: maths question Pin
itprorh665-Feb-20 4:43
Memberitprorh665-Feb-20 4:43 
AnswerRe: maths question Pin
Rick Shaub4-Feb-20 11:28
MemberRick Shaub4-Feb-20 11:28 
AnswerRe: maths question Pin
Gerry Schmitz5-Feb-20 8:04
mveGerry Schmitz5-Feb-20 8:04 
GeneralWSO CCC OTD 2020-02-03 Pin
OriginalGriff2-Feb-20 21:42
mveOriginalGriff2-Feb-20 21:42 
GeneralRe: WSO CCC OTD 2020-02-03 Pin
pkfox2-Feb-20 22:08
professionalpkfox2-Feb-20 22:08 
GeneralRe: WSO CCC OTD 2020-02-03 - we have a winner! Pin
OriginalGriff2-Feb-20 22:14
mveOriginalGriff2-Feb-20 22:14 
GeneralRe: WSO CCC OTD 2020-02-03 - we have a winner! Pin
musefan2-Feb-20 22:41
Membermusefan2-Feb-20 22:41 
GeneralRe: WSO CCC OTD 2020-02-03 - we have a winner! Pin
OriginalGriff2-Feb-20 22:57
mveOriginalGriff2-Feb-20 22:57 
GeneralI might need to optimize this XD Pin
honey the codewitch2-Feb-20 6:02
mvahoney the codewitch2-Feb-20 6:02 
GeneralRe: I might need to optimize this XD Pin
Eddy Vluggen2-Feb-20 7:02
professionalEddy Vluggen2-Feb-20 7:02 
GeneralRe: I might need to optimize this XD Pin
honey the codewitch2-Feb-20 7:28
mvahoney the codewitch2-Feb-20 7:28 
GeneralRe: I might need to optimize this XD Pin
Eddy Vluggen2-Feb-20 7:43
professionalEddy Vluggen2-Feb-20 7:43 
GeneralRe: I might need to optimize this XD Pin
honey the codewitch2-Feb-20 9:29
mvahoney the codewitch2-Feb-20 9:29 
GeneralRe: I might need to optimize this XD Pin
Jon McKee2-Feb-20 12:54
professionalJon McKee2-Feb-20 12:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.