SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API12 Mar 2010

How do I calculate cube root and square root of a number?

To calculate the cube root and the square root of a double value we can use the Math.cbrt(double a) and Math.sqrt(double a) static method call. package org.kodejava.math; public class CubeSquareRootExample { public static void main(String[] args) { double cube = 125.0d; double square = 100.0d; // Get the cube root of double value double cubeRoot […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API09 Mar 2010

How do I reread the content of a buffer?

The example shown below tells you how to reread the contents of a buffer. To reread the data from a buffer we can use the buffer’s rewind() method. This method set the position back to 0 while the limit is unchanged, it still holds the value of how many data can be read from the […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API09 Mar 2010

How do I use trigonometric calculation methods?

This example demonstrates how to use the trigonometric methods of the java.lang.Math class. You can see the use of method such as Math.sin(), Math.cos(), Math.tan(), etc. package org.kodejava.math; public class TrigonometricExample { public static void main(String[] args) { double radians = 1.0d; double sine = Math.sin(radians); double cosine = Math.cos(radians); double tan = Math.tan(radians); double […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API06 Mar 2010

How do I convert angle from radians to degrees?

The example below show you how to convert an angle measured in radians into degrees and vice versa. We can use the Math.toDegrees() and Math.toRadians() method call to do the conversion. package org.kodejava.math; public class RadiansDegreeConversionExample { public static void main(String[] args) { double radians = 1.0d; double degrees = 45d; // Converts an angle […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API05 Mar 2010

How do I get the PI value?

The number π is a mathematical constant, the ratio of a circle’s circumference to its diameter, commonly approximated as 3.14159. It has been represented by the Greek letter “π” since the mid-18th century, though it is also sometimes spelled out as “pi” (/paɪ/). From: Wikipedia The code snippet below show you how to obtain the […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API02 Mar 2010

How do I get the minimum or maximum value between two numbers?

The code below show you how to use the Math.min() and Math.max() method call the get the minimum and maximum value between two numbers. As other method in the Math class these methods also overloaded to accept many types of primitive data. package org.kodejava.math; public class GetMinMaxValueExample { public static void main(String[] args) { Double […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.