# lorentzCurve: Compute a Lorentzian Curve In SpecHelpers: Spectroscopy Related Utilities

## Description

Computes the y values describing a Lorentzian curve such as seen in an NMR peak. Requires a range of x values and parameters for peak position, area, and gamma (half the peak width at half-height).

## Usage

 `1` ```lorentzCurve(x, x0, area, gamma) ```

## Arguments

 `x` A vector of x values which will be used to compute the corresponding y values. Use enough to give good resolution. `x0` The position of the peak. Must fall in the range of x, of course. `area` The area of the peak, in arbitrary units. `gamma` HWHM, half-width at half-maximum. The peak "width" in units corresponding to x.

## Value

A vector of y values corresponding to the x values supplied.

## Author(s)

Bryan A. Hanson, DePauw University. hanson@depauw.edu

`gaussCurve`, `makeSpec`, `plotNMRspec` and `plot2DNMRspec` for drawing NMR spectra.
 ```1 2 3 4 5 6 7``` ```myx <- seq(0, 100, length.out = 1000) # use lots of point for resolution myy <- lorentzCurve(x = myx, area = 1, x0 = 40, gamma = 5) plot(myx, myy, type = "l", main = "Pure Lorentzian Curve") y = 0.5*max(myy) x = seq(40, 45, 0.5) points(x = x, y = rep(y, length(x)), col = "blue", type = "l") text(x = 42, y = y + 0.005, labels = c("gamma"), col = "blue", srt = 90) ```