Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

polar to cartesian java

static double[] cari(double r, double theta) {
    theta = (theta / 180) * Math.PI;
    return new double[]{r * Math.cos(theta), r * Math.sin(theta)};
}
Comment

java cartesian to polar

public static double[] pol(double x, double y) {
	//return new double[]{Math.sqrt(x * x + y * y), Math.atan2(y, x)}; //red
	return new double[]{Math.sqrt(x * x + y * y), (Math.atan2(y, x) * 180) / Math.PI}; //cart
}
Comment

PREVIOUS NEXT
Code Example
Java :: iterate over string java 
Java :: how to remove java from ubuntu 
Java :: how to close the fragment by a close button in android 
Java :: add days to date java 
Java :: java unique id 
Java :: spring create bean only if another bean does not exists 
Java :: complicated average java code 
Java :: deque in java 
Java :: react native webview debug network 
Java :: java get specific element from arraylist 
Java :: convert string to char array in java 
Java :: minecraft plugin send all players message 
Java :: decimal format 
Java :: java get domain from url 
Java :: rwegex java 
Java :: spring h2 database dependency 
Java :: youTubeInitializationResult gives SERVICE_MISSING error in android 
Java :: print arraylist java 
Java :: java swing absolute position 
Java :: java max from 3 parameters 
Java :: how to byheart faster 
Java :: how to delete character certain index in java 
Java :: android view to bitmap 
Java :: localdate to date java 
Java :: check the string has spaces in it in java 
Java :: coding collections clear method java 
Java :: play sound on button click android studio 
Java :: implement graph in java example 
Java :: spigot execute command as player 
Java :: how to get index of second occurrence java 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =