# package cmplx
`import "math/cmplx"`
cmplx包提供了复数的常用常数和常用函数。
## Index
* [func NaN() complex128](#NaN)
* [func IsNaN(x complex128) bool](#IsNaN)
* [func Inf() complex128](#Inf)
* [func IsInf(x complex128) bool](#IsInf)
* [func Abs(x complex128) float64](#Abs)
* [func Phase(x complex128) float64](#Phase)
* [func Polar(x complex128) (r, θ float64)](#Polar)
* [func Rect(r, θ float64) complex128](#Rect)
* [func Conj(x complex128) complex128](#Conj)
* [func Sqrt(x complex128) complex128](#Sqrt)
* [func Log(x complex128) complex128](#Log)
* [func Log10(x complex128) complex128](#Log10)
* [func Exp(x complex128) complex128](#Exp)
* [func Pow(x, y complex128) complex128](#Pow)
* [func Sin(x complex128) complex128](#Sin)
* [func Cos(x complex128) complex128](#Cos)
* [func Tan(x complex128) complex128](#Tan)
* [func Cot(x complex128) complex128](#Cot)
* [func Asin(x complex128) complex128](#Asin)
* [func Acos(x complex128) complex128](#Acos)
* [func Atan(x complex128) complex128](#Atan)
* [func Sinh(x complex128) complex128](#Sinh)
* [func Cosh(x complex128) complex128](#Cosh)
* [func Tanh(x complex128) complex128](#Tanh)
* [func Asinh(x complex128) complex128](#Asinh)
* [func Acosh(x complex128) complex128](#Acosh)
* [func Atanh(x complex128) complex128](#Atanh)
## func [NaN](https://github.com/golang/go/blob/master/src/math/cmplx/isnan.go#L22 "View Source")
```
func NaN() complex128
```
返回一个复数的“Not A Number”值。
## func [IsNaN](https://github.com/golang/go/blob/master/src/math/cmplx/isnan.go#L11 "View Source")
```
func IsNaN(x complex128) bool
```
如果x的实部或者虚部是“Not A Number”值,则返回真。
## func [Inf](https://github.com/golang/go/blob/master/src/math/cmplx/isinf.go#L18 "View Source")
```
func Inf() complex128
```
返回一个复数的无穷大,complex(+Inf, +Inf)。
## func [IsInf](https://github.com/golang/go/blob/master/src/math/cmplx/isinf.go#L10 "View Source")
```
func IsInf(x complex128) bool
```
如果x的实部或者虚部是无穷(不管正负),则返回真。
## func [Abs](https://github.com/golang/go/blob/master/src/math/cmplx/abs.go#L12 "View Source")
```
func Abs(x complex128) float64
```
返回x的绝对值(也被称为模)。
## func [Phase](https://github.com/golang/go/blob/master/src/math/cmplx/phase.go#L11 "View Source")
```
func Phase(x complex128) float64
```
返回x的相位(也被称为幅角),返回值范围[-Pi, Pi]。
## func [Polar](https://github.com/golang/go/blob/master/src/math/cmplx/polar.go#L10 "View Source")
```
func Polar(x complex128) (r, θ float64)
```
将直角坐标的复数表示为极坐标(r, θ)。其中r是x的绝对值,θ是x的相位,范围[-Pi, Pi]。
## func [Rect](https://github.com/golang/go/blob/master/src/math/cmplx/rect.go#L10 "View Source")
```
func Rect(r, θ float64) complex128
```
返回极坐标(r, θ)表示的复数。
## func [Conj](https://github.com/golang/go/blob/master/src/math/cmplx/conj.go#L8 "View Source")
```
func Conj(x complex128) complex128
```
返回x的共轭复数(实部相等,虚部相反)。
## func [Sqrt](https://github.com/golang/go/blob/master/src/math/cmplx/sqrt.go#L58 "View Source")
```
func Sqrt(x complex128) complex128
```
返回x的平方根。返回值的实部不小于0,而虚部的正负号和x的虚部相同。
## func [Log](https://github.com/golang/go/blob/master/src/math/cmplx/log.go#L57 "View Source")
```
func Log(x complex128) complex128
```
返回x的自然对数。
## func [Log10](https://github.com/golang/go/blob/master/src/math/cmplx/log.go#L62 "View Source")
```
func Log10(x complex128) complex128
```
返回x的常用对数。
## func [Exp](https://github.com/golang/go/blob/master/src/math/cmplx/exp.go#L51 "View Source")
```
func Exp(x complex128) complex128
```
返回e\*\*x。
## func [Pow](https://github.com/golang/go/blob/master/src/math/cmplx/pow.go#L49 "View Source")
```
func Pow(x, y complex128) complex128
```
返回x\*\*y;有如下特例:
```
Pow(0, ±0) returns 1+0i
Pow(0, c) 如果image(c)==0,则当real(c)<0时返回Inf+0i;否则返回Inf+Inf i
```
## func [Sin](https://github.com/golang/go/blob/master/src/math/cmplx/sin.go#L53 "View Source")
```
func Sin(x complex128) complex128
```
求正弦。
## func [Cos](https://github.com/golang/go/blob/master/src/math/cmplx/sin.go#L98 "View Source")
```
func Cos(x complex128) complex128
```
求余弦。
## func [Tan](https://github.com/golang/go/blob/master/src/math/cmplx/tan.go#L59 "View Source")
```
func Tan(x complex128) complex128
```
求正切。
## func [Cot](https://github.com/golang/go/blob/master/src/math/cmplx/tan.go#L175 "View Source")
```
func Cot(x complex128) complex128
```
求余切。
## func [Asin](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L51 "View Source")
```
func Asin(x complex128) complex128
```
求反正弦。
## func [Acos](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L94 "View Source")
```
func Acos(x complex128) complex128
```
求反余弦。
## func [Atan](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L142 "View Source")
```
func Atan(x complex128) complex128
```
求反正切。
## func [Sinh](https://github.com/golang/go/blob/master/src/math/cmplx/sin.go#L73 "View Source")
```
func Sinh(x complex128) complex128
```
求双曲正弦。
## func [Cosh](https://github.com/golang/go/blob/master/src/math/cmplx/sin.go#L117 "View Source")
```
func Cosh(x complex128) complex128
```
求双曲余弦。
## func [Tanh](https://github.com/golang/go/blob/master/src/math/cmplx/tan.go#L83 "View Source")
```
func Tanh(x complex128) complex128
```
求双曲正切。
## func [Asinh](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L67 "View Source")
```
func Asinh(x complex128) complex128
```
求反双曲正弦。
## func [Acosh](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L100 "View Source")
```
func Acosh(x complex128) complex128
```
求反双曲余弦。
## func [Atanh](https://github.com/golang/go/blob/master/src/math/cmplx/asin.go#L166 "View Source")
```
func Atanh(x complex128) complex128
```
求反双曲正切。
- 库
- package achive
- package tar
- package zip
- package bufio
- package builtin
- package bytes
- package compress
- package bzip2
- package flate
- package gzip
- package lzw
- package zlib
- package container
- package heap
- package list
- package ring
- package crypto
- package aes
- package cipher
- package des
- package dsa
- package ecdsa
- package elliptic
- package hmac
- package md5
- package rand
- package rc4
- package rsa
- package sha1
- package sha256
- package sha512
- package subtle
- package tls
- package x509
- package pkix
- package database
- package sql
- package driver
- package encoding
- package ascii85
- package asn1
- package base32
- package base64
- package binary
- package csv
- package gob
- package hex
- package json
- package pem
- package xml
- package errors
- package expvar
- package flag
- package fmt
- package go
- package doc
- package format
- package parser
- package printer
- package hash
- package adler32
- package crc32
- package crc64
- package fnv
- package html
- package template
- package image
- package color
- package palette
- package draw
- package gif
- package jpeg
- package png
- package index
- package suffixarray
- package io
- package ioutil
- package log
- package syslog
- package math
- package big
- package cmplx
- package rand
- package mime
- package multipart
- package net
- package http
- package cgi
- package cookiejar
- package fcgi
- package httptest
- package httputil
- package pprof
- package mail
- package rpc
- package jsonrpc
- package smtp
- package textproto
- package url
- package os
- package exec
- package signal
- package user
- package path
- package filepath
- package reflect
- package regexp
- package runtime
- package cgo
- package debug
- package pprof
- package race
- package sort
- package strconv
- package strings
- package sync
- package atomic
- package text
- package scanner
- package tabwriter
- package template
- package time
- package unicode
- package utf16
- package utf8
- package unsafe