convert - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Conversion : convert

convert

convert an expression to a different form

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

convert(expr, form, arg3, ...)

Parameters

expr

-

any expression

form

-

name

arg3, ...

-

(optional) other arguments

Description

• 

The convert function is used to convert an expression from one form to another.  Some of the conversions are data-type conversions, for example convert([x, y], set)  Others are form or function conversions, for example convert(x^3-3*x^2+7*x+9, horner, x)  yields  9+(7+(-3+x)*x)*x and convert(a*x!, GAMMA) yields a*GAMMA(x+1).

• 

For function conversions, a set of optional arguments to perform the conversion in different manners are described in convert/to_special_function.

• 

The types of known conversions are (the second argument form must be one of these):

`*`

`+`

`0F1`

`1F1`

`2F1`

Abel

Abel_RNF

abs

Airy

algebraic

and

arabic

arctrig

arctrigh

arithop

Array

array

base

Bessel

Bessel_related

binary

binomial

boolean_function

boolean_operator

ByteArray

bytes

Chebyshev

compose

confrac

conversion_table

Cylinder

D

decimal

degrees

DESol

diff

dimensions

disjcyc

Ei

Ei_related

elementary

Elliptic_related

english

equality

erf

erf_related

erfc

exp

expln

expsincos

factorial

FirstKind

float

FormalPowerSeries

fullparfrac

function_rules

GAMMA_related

global

Hankel

Heaviside

Heun

hypergeom

int

Int

iupac

Kelvin

Kummer

Legendre

linearODE

listlist(deprecated)

listofequations

ln

local

mathorner

Matrix

matrix

MatrixPolynomialObject

MeijerG

metric(deprecated)

MobiusR

MobiusX

MobiusY

mod2

ModifiedMeijerG

name

NormalForm

numericproc

octal

or

ordinal

package

parfrac

permlist

phaseamp

PhysicsVectors

piecewise

PLOT3Doptions

PLOToptions

polar

POLYGONS

polynom

power

pwlist

radians

radical

rational

ratpoly

RealRange

record

relation

Riccati

roman

SecondKind

setofequations

signum

sqrfree

StandardFunctions

string

sum

Sum

surd

symbol

system

table

tan

temperature

to_special_function

trig

trigh

truefalse

unit_free

unit_name

units

Vector

vector

Whittaker

windchill

xor

y_x

 

• 

Further information is available under help pages convert/form where form is one of the forms from the above list.

• 

A user can make custom conversions known to the convert function by defining a Maple procedure in the following way.  If the procedure `convert/f` is defined, then the function call convert(a, f, x, y, ...) will invoke `convert/f`(a, x, y, ...); Note that the procedure may be indexed, for example convert([1,2,3], Vector[row]);

Examples

Convert can be used to convert numbers between bases.  See the help pages convert/decimal, convert/base, convert/binary, convert/octal, and convert/hex for more information and examples.

convert9,binary

1001

(1)

Convert between degrees and radians.  See the help pages convert/degrees and convert/radians for more information.

convertπ,degrees

180degrees

(2)

Convert to rational expressions or floating-point numbers. See the help pages convert/float and convert/rational for more information.

convert1.23456,rational

38583125

(3)

convert18,float,3

0.125

(4)

Convert between units. See the help page convert/units for more information.  Also, see the Units package.

convert22,units,inches,m

13972500

(5)

Convert between Roman numerals and integers. See the help pages convert/arabic and convert/roman for more information.

convertXI,arabic

11

(6)

Convert all the operands of a list, set, or expression to addition or multiplication. See the help page convert/`+` for more information.

convert1,2,3,4,`+`

10

(7)

fseqxii,i=1..4

f:=x1,x22,x33,x44

(8)

convertf,`*`

x1x22x33x44

(9)

Convert a given list, set, or expression to 'and', 'or', or 'xor' form.  See the help page convert/and for more information.

convertx,y,`and`

xandy

(10)

Convert a rational expression to partial fraction form. See the help page convert/parfrac for more information.

fx3+xx21

f:=x3+xx21

(11)

convertf,parfrac,x

x+1x1+1x+1

(12)

Convert a series to a polynomial by dropping the order term. See the help page convert/polynom for more information.

sseriesf,x,4

s:=x2x3+Ox5

(13)

converts,polynom

2x3x

(14)

Convert a complex expression to polar coordinates. See the help page convert/polar for more information.

convert12+I2,polar

polar122,14π

(15)

Convert an expression to trigonometric or exponential form, if possible. See the help pages convert/exp and convert/trig for more information.

gsinhx+sinx

g:=sinhx+sinx

(16)

convertg,exp

12ⅇx12ⅇx12IⅇIxⅇIx

(17)

Check the list above for all known types of conversions for more possibilities. Conversions to more advanced mathematical functions are shown below.

hBesselJa,z

h:=BesselJa,z

(18)

jconverth,hypergeom

j:=zahypergeom,a+1,14z2Γa+12a

(19)

convertj,Bessel

BesselJa,z

(20)

See Also

convert/PhysicsVectors

convert/VectorCalculus

ExtendingMaple

operators/binary

surd

type

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam