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 :: java check if sql table exists 
Java :: java create list with one element 
Java :: protocollib onenable 
Java :: decimal format 
Java :: int to string java 
Java :: java test if a string is a int 
Java :: java get size of jframe 
Java :: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 
Java :: brxm remove property 
Java :: Could not identify launch activity: Default Activity not found 
Java :: java stream to list 
Java :: java boilerplate 
Java :: android java get current date 
Java :: open a new activity on click of a button 
Java :: java array swap 
Java :: how to find smallest number in array java 
Java :: check java version 
Java :: java randint 
Java :: jpa repository delete method return value 
Java :: how to set landscape in android studio 
Java :: how to create a item in minecraft modding 
Java :: formartted string java 
Java :: how to test how many of one character is in a string java 
Java :: spring enable cors 
Java :: java code examples 
Java :: spigot execute command as player 
Java :: how to convert outputstream to bytearrayoutputstream in java 
Java :: char cannot be converted to string 
Java :: difference between java and javax 
Java :: random number between 1 and 100 java 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =