In mathematics, a Cartesian coordinate system is a coordinate system that specifies each point uniquely in a plane by a set of numeric points. Cartesian Coordinates is represented by (x,y) . In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference point known as radius and an angle from a reference direction known as theta or simply angle. Polar Coordinates system is represented by (r,θ) . For the negative value of r in polar coordinates, what to do? Watch the given below youtube video to cover it. https://www.youtube.com/watch?v=kNANYzuOUpA Fig: Polar Coordinates Check this website for more knowledge: https://openstax.org/books/calculus-volume-2/pages/7-3-polar-coordinates C++ PROGRAM : DEFINE TWO CLASSES POLAR AND RECTANGLE REPRESENT POINTS IN POLAR AND RECTANGULAR SYSTEM. USE SUITABLE MEMBER FUNCTIONS TO CONVERT FROM ONE SYSTEM TO ANOTHER...
SAME NAME IN CLASS METHOD AND CONSTRUCTOR, STATIC VARIABLE class Emp { String ename; int age; int sal; static int count=0; int empno; Emp() { } void Emp(String n, int a, int s) { count+=1; empno=count; ename=n; age=a; sal=s; } void show() { System.out.println("Emp_no: "+empno); System.out.println("Emp_name: "+ename); System.out.println("Emp_ag...
Python Program to Find HCF or GCD In this example, you will learn to find the GCD of two numbers using function and loop. The highest common factor (H.C.F) or greatest common divisor (G.C.D) of two numbers is the largest positive integer that perfectly divides the two given numbers. For example, the H.C.F of 12 and 14 is 2. Source Code: Using Loops # Python program to find H.C.F of two numbers # define a function def compute_hcf(x, y): # choose the smaller number if x > y: smaller = y else: smaller = x for i in range(1, smaller+1): if((x % i == 0) and (y % i == 0)): hcf = i return hcf num1 = int(input("Enter the first number: ")) num2 = int(input("Enter the second number: ")) print("The H.C.F. is", compute_hcf(num1, num2)) Output: D:\PROGRAMMING\PYTHON>python Hcf.py Enter the first number: 8 Enter the second number: 12 The H.C.F. is 4 D:\PROGRAMMING\PYTHON>python Hcf.py Enter the fi...
Comments
Post a Comment