toLatex.polynomial: toLatex.polynomial

View source: R/polynomial.R

toLatex.polynomialR Documentation

toLatex.polynomial

Description

Returns a LaTeX representation of the polynomial.

Usage

## S3 method for class 'polynomial'
toLatex(
  object,
  digits = TRUE,
  decreasing = FALSE,
  variable = "x",
  simplify = TRUE,
  tol = 1e-09,
  ...
)

Arguments

object

polynomial

digits

numeric or logical: how to convert to text (default: NA)

decreasing

logical: order of the terms by increasing or decreasing powers (default: FALSE)

variable

character: name of variable used (default: "x")

simplify

logical: should the polynomial representation be simplified (default: TRUE)

tol

numeric: tolerance (default: 1e-9). A negative value will keep zeros and ones, too.

  • If a coefficient is smaller than tol then zero terms are not kept.

  • If a absolute value of coefficient minus one is smaller than tol then coefficient is not kept.

...

unused

Value

character

Examples

p <- polynomial(c(-1,0,2)/3)
toLatex(p, 4)
toLatex(p, FALSE)
toLatex(p, TRUE)
toLatex(p, variable="z")
toLatex(p, decreasing=TRUE)
p <- polynomial(c(0,1,2)/3)
toLatex(p)
toLatex(p, tol=-1)

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.