[UP]


Manual Reference Pages  - quadratic (1)

NAME

quadratic(1f) - [MATH] Calculate and print the roots of a quadratic formula even if they are complex (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

quadratic A B C [ --verbose]|[ --help| --version]

DESCRIPTION

Given the equation

      A*x**2 + B*x + C = 0

Use the quadratic formula to determine the root values of the equation.

OPTIONS

A,B,C coefficients
--verbose
  echo input values
--help display help text and exit
--version
  display version information and exit

EXAMPLE

This program uses NAMELIST to crack the command line arguments, and complex numbers.

Sample usage:

   quadratic A=1.0  B=5.0  C=2.0
    for 1*x**2 + 5*x + 2 = 0
    the roots (ie. "x intercepts") are real so the parabola crosses the x-axis at two points:
    z1 =-0.438447237
    z2 =-4.561553
    discriminant =17

quadratic A=1.0 B=2.0 C=5.0 # There are no real roots (Discriminant = -16)! for 1*x**2 + 2*x + 5 = 0 the roots(ie. "x intercepts") are complex: z1 = ( -1.00000000 , 2.00000000 ) z2 = ( -1.00000000 , -2.00000000 ) discriminant =-16

quadratic A=9 B=12 C=4 for 9*x**2 + 12*x + 4 = 0 the roots (ie. "x intercepts") are repeated (real and equal) so the parabola just touches the x-axis at: z1 = z2 =-0.666666687 discriminant =0

AUTHOR

John S. Urban

LICENSE

Public Domain


quadratic (1) March 11, 2021
Generated by manServer 1.08 from 339e9e55-17ac-44bf-8863-50d97817a254 using man macros.