complx.Rect() Function in Golang With Examples Last Updated : 28 Apr, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report complx.Rect() Function in Golang returns the complex number x with polar coordinates r, θ. It takes the float value as input and return complex number. This method belongs to complex package. Syntax: func Rect(r, θ float64) complex128; Here, r and θ are the complex numbers with float64 real as well as imaginary parts. Return Value: It returns a complex number of polar coordinates r and θ. Example 1: This example computes the value by passing arguments(5, 45). C // Golang program to illustrate // the complx.Rect() Function package main // importing fmt and math/cmplx import ( "fmt" "math/cmplx" ) // Calling Main method func main () { // using the function fmt.Printf ("%.1f", cmplx.Rect (5, 45)) } Output: (2.6+4.3i) Example 2: C // Golang program to illustrate // the complx.Rect() Function package main // importing fmt, math and math/cmplx import ( "fmt" "math" "math/cmplx" ) // Calling Main method func main() { // using the function fmt.Printf("%.1f,", cmplx.Rect(5, 4*math.Pi)) fmt.Printf("%.1f", cmplx.Rect(5, 90)) } Output: (5.0-0.0i),(-2.2+4.5i) Comment More infoAdvertise with us Next Article complx.Polar() Function in Golang With Examples P PranchalKatiyar Follow Improve Article Tags : Go Language Golang-Complex Similar Reads reflect.Complex() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Complex() Function in Golang is used to get the v's underlying value. To access this function, one needs to impor 1 min read reflect.Copy() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Copy() Function in Golang is used to copies the contents of the source into destination until either destination 2 min read complx.Pow() Function in Golang With Examples complx.Pow() Function in Golang is used to find x**y, the base-x exponential of y. For this function, one need to import the "math/cmplx" package. Syntax: func Pow(x, y complex128) complex128 Pow(0, ±0) returns 1+0i Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i Pa 1 min read complx.Polar() Function in Golang With Examples complx.Polar() Function in Golang returns the absolute value r and phase θ of x. The phase θ will be in the range [-Pi, Pi]. Syntax: func Polar(x complex128) (r, θ float64) Here, x is a complex number. Return Value: The return value is in the range [-Pi, Pi]. Example 1: C // Golang 2 min read reflect.Cap() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Cap() Function in Golang is used to get the v's capacity. To access this function, one needs to imports the refle 1 min read reflect.Call() Function in Golang with Examples Go language provides inbuilt support implementation of run-time reflection and allowing a program to manipulate objects with arbitrary types with the help of reflect package. The reflect.Call() Function in Golang is used to calls the function v with the input arguments in. To access this function, o 2 min read Like