
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Angle Between a Chord and a Tangent in C++
In case of a given circle, chord and tangent is met at a particular point. The angle in the alternate segment is provided. The main job here is to find the angle between the chord and the tangent.
Examples
Input: z = 40 Output: 40 degrees Input: z = 60 Output: 60 degrees
Approach
Let, angle QPR is the given angle in the alternate segment.
Let, the angle between the chord and circle = angle RQY = a
Because line drawn from center on the tangent is perpendicular,
So, angle CQR = 90-a
As, CQ = CR = radius of the circle
So, angle CRQ = 90-a
-
Now, in triangle CQR,
angle CQR + angle CRQ + angle QCR = 180
angle QCR = 180 - (90-a) - (90-a)
angle QCR = 2a
As angle at the circumference of a circle be the half the angle at the centre subtended by the same arc,so, angle QPR = a
Hence, angle QPR = angle RQY
The approach is implemented in following way −
Example
// C++ program to find the angle // between a chord and a tangent // at the time when angle in the alternate segment is given #include <bits/stdc++.h> using namespace std; void anglechordtang(int z1){ cout<< "The angle between tangent" <<" and the chord is " << z1 <<" degrees" << endl; } // Driver code int main(){ int z1 = 40; anglechordtang(z1); return 0; }
Output
The angle between tangent and the chord is 40 degrees