Convert milliradian to degree

Here given code implementation process.

//C Program 
//Convert milliradian to degree
#include <stdio.h>

#include <math.h>

//Find the degree of given milliradian
void milliradian_to_degree(double milliradian)
{
	// Formula : (milliradian*180)/(π*1000)
	// Calculate given milliradian to degree 
	double degree = (milliradian * 180) / (M_PI * 1000);
	//Display result
	printf("Milliradian : %lf  Degree : %lf\n", milliradian, degree);
}
int main()
{
	//Simple test
	milliradian_to_degree(1);
	milliradian_to_degree(70.8);
	milliradian_to_degree(1000.5);
	return 0;
}

Output

Milliradian : 1.000000  Degree : 0.057296
Milliradian : 70.800000  Degree : 4.056541
Milliradian : 1000.500000  Degree : 57.324427
/*
  C++ program
  Convert milliradian to degree 
*/
#include<iostream>
#include<math.h>
using namespace std;
class MyMath
{
	public:
		//Find the degree of given milliradian
		void milliradian_to_degree(double milliradian)
		{
			// Formula : (radian*180)/(π*1000)
			// Calculate given milliradian to degree 
			double degree = (milliradian * 180) / (M_PI * 1000);
			cout << "Milliradian : " << milliradian << " Degree : " << degree << "\n";
		}
};
int main()
{
	MyMath obj =  MyMath();
	//Simple test
	obj.milliradian_to_degree(1);
	obj.milliradian_to_degree(70.80);
	obj.milliradian_to_degree(1000.50);
	return 0;
}

Output

Milliradian : 1 Degree : 0.0572958
Milliradian : 70.8 Degree : 4.05654
Milliradian : 1000.5 Degree : 57.3244
/*
  Java program
  Convert milliradian to degree 
*/
class MyMath
{
	//Find the degree of given milliradian
	public void milliradian_to_degree(double milliradian)
	{
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		double degree = (milliradian * 180) / (Math.PI * 1000);
		System.out.print("Milliradian : " + milliradian + " Degree : " + degree + "\n");
	}
	public static void main(String[] args)
	{
		MyMath obj = new MyMath();
		//Simple test
		obj.milliradian_to_degree(1);
		obj.milliradian_to_degree(70.80);
		obj.milliradian_to_degree(1000.50);
	}
}

Output

Milliradian : 1.0 Degree : 0.057295779513082325
Milliradian : 70.8 Degree : 4.056541189526229
Milliradian : 1000.5 Degree : 57.324427402838865
/*
  C# program
  Convert milliradian to degree 
*/
using System;
class MyMath
{
	//Find the degree of given milliradian
	public void milliradian_to_degree(double milliradian)
	{
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		double degree = (milliradian * 180) / (Math.PI * 1000);
		Console.Write("Milliradian : " + milliradian + " Degree : " + degree + "\n");
	}
	public static void Main(String[] args)
	{
		MyMath obj = new MyMath();
		//Simple test
		obj.milliradian_to_degree(1);
		obj.milliradian_to_degree(70.80);
		obj.milliradian_to_degree(1000.50);
	}
}

Output

Milliradian : 1 Degree : 0.0572957795130823
Milliradian : 70.8 Degree : 4.05654118952623
Milliradian : 1000.5 Degree : 57.3244274028389
<?php
/*
  Php program
  Convert milliradian to degree 
*/
class MyMath
{
	//Find the degree of given milliradian
	public	function milliradian_to_degree($milliradian)
	{
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		$degree = ($milliradian * 180) / (M_PI * 1000);
		echo "Milliradian : ". $milliradian ." Degree : ". $degree ."\n";
	}
}

function main()
{
	$obj = new MyMath();
	//Simple test
	$obj->milliradian_to_degree(1);
	$obj->milliradian_to_degree(70.80);
	$obj->milliradian_to_degree(1000.50);
}
main();

Output

Milliradian : 1 Degree : 0.057295779513082
Milliradian : 70.8 Degree : 4.0565411895262
Milliradian : 1000.5 Degree : 57.324427402839
/*
  Node Js program
  Convert milliradian to degree 
*/
class MyMath
{
	//Find the degree of given milliradian
	milliradian_to_degree(milliradian)
	{
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		var degree = (milliradian * 180) / (Math.PI * 1000);
		process.stdout.write("Milliradian : " + milliradian + " Degree : " + degree + "\n");
	}
}

function main()
{
	var obj = new MyMath();
	//Simple test
	obj.milliradian_to_degree(1);
	obj.milliradian_to_degree(70.80);
	obj.milliradian_to_degree(1000.50);
}
main();

Output

Milliradian : 1 Degree : 0.057295779513082325
Milliradian : 70.8 Degree : 4.056541189526229
Milliradian : 1000.5 Degree : 57.324427402838865
#   Python 3 program
#   Convert milliradian to degree 
import math

class MyMath :
	# Find the degree of given milliradian
	def milliradian_to_degree(self, milliradian) :
		#  Formula : (radian*180)/(π*1000)
		#  Calculate given milliradian to degree 
		degree = (milliradian * 180) / (math.pi * 1000)
		print("Milliradian : ", milliradian ," Degree : ", degree ,"\n", end = "")
	

def main() :
	obj = MyMath()
	# Simple test
	obj.milliradian_to_degree(1)
	obj.milliradian_to_degree(70.80)
	obj.milliradian_to_degree(1000.50)

if __name__ == "__main__": main()

Output

Milliradian :  1  Degree :  0.057295779513082325
Milliradian :  70.8  Degree :  4.056541189526229
Milliradian :  1000.5  Degree :  57.324427402838865
#   Ruby program
#   Convert milliradian to degree 

class MyMath

	# Find the degree of given milliradian
	def milliradian_to_degree(milliradian)
	
		#  Formula : (radian*180)/(π*1000)
		#  Calculate given milliradian to degree 
		degree = (milliradian * 180) / (Math::PI * 1000)
		print("Milliradian : ", milliradian ," Degree : ", degree ,"\n")
	end
end
def main()

	obj = MyMath.new()
	# Simple test
	obj.milliradian_to_degree(1)
	obj.milliradian_to_degree(70.80)
	obj.milliradian_to_degree(1000.50)
end
main()

Output

Milliradian : 1 Degree : 0.057295779513082325
Milliradian : 70.8 Degree : 4.056541189526229
Milliradian : 1000.5 Degree : 57.324427402838865
/*
  Scala program
  Convert milliradian to degree 
*/
class MyMath
{
	//Find the degree of given milliradian
	def milliradian_to_degree(milliradian: Double): Unit = {
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		var degree: Double = (milliradian * 180) / (Math.PI * 1000);
		print("Milliradian : " + milliradian + " Degree : " + degree + "\n");
	}
}
object Main
{
	def main(args: Array[String]): Unit = {
		var obj: MyMath = new MyMath();
		//Simple test
		obj.milliradian_to_degree(1);
		obj.milliradian_to_degree(70.80);
		obj.milliradian_to_degree(1000.50);
	}
}

Output

Milliradian : 1.0 Degree : 0.057295779513082325
Milliradian : 70.8 Degree : 4.056541189526229
Milliradian : 1000.5 Degree : 57.324427402838865
/*
  Swift program
  Convert milliradian to degree 
*/

import Foundation

class MyMath
{
	//Find the degree of given milliradian
	func milliradian_to_degree(_ milliradian: Double)
	{
		// Formula : (radian*180)/(π*1000)
		// Calculate given milliradian to degree 
		let degree: Double = (milliradian * 180) / (Double.pi * 1000);
		print("Milliradian : ", milliradian ," Degree : ", degree ,"\n", terminator: "");
	}
}
func main()
{
	let obj: MyMath = MyMath();
	//Simple test
	obj.milliradian_to_degree(1);
	obj.milliradian_to_degree(70.80);
	obj.milliradian_to_degree(1000.50);
}
main();

Output

Milliradian :  1.0  Degree :  0.0572957795130823
Milliradian :  70.8  Degree :  4.05654118952623
Milliradian :  1000.5  Degree :  57.3244274028389


Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment







© 2021, kalkicode.com, All rights reserved