Function Repository Resource:

NormalLineThrough

Source Notebook

Compute properties of the line normal (perpendicular) to a given line and passing through a given point

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["NormalLineThrough"][expr,{x,a},{y,b}]

returns an Association of properties for the line passing through the point {x,y}={a,b} and normal to expr, a linear function in x.

ResourceFunction["NormalLineThrough"][expr,{x,a},{y,b},prop]

returns the normal line property prop.

Details

Allowed values for prop are:
"SlopeInterceptEquation"equation of the normal line in slope-intercept form
"StandardFormEquation"equation of the normal line in standard form
"PointSlopeEquation"equation of the normal line in point-slope form
"Slope"slope of the normal line
"HorizontalIntercept"horizontal intercept of the normal line
"VerticalIntercept"vertical intercept of the normal line
"Plot"plot of the normal line
AllAssociation of all allowed properties
If expr does not have head Equal, then expr is treated as an expression defining y in terms of x. In other words, ResourceFunction["NormalLineThrough"][expr,{x,a},y,] is equivalent to ResourceFunction["NormalLineThrough"][y==expr,{x,a},y,] if expr has a head other than Equal.

Examples

Basic Examples (2) 

Get the point-slope equation of a line normal to y=3x/2+4 that passes through the point (x,y)=(1,-1):

In[1]:=
ResourceFunction["NormalLineThrough"][
 3 x/2 + 4, {x, 1}, {y, -1}, "PointSlopeEquation"]
Out[1]=

Visualize this result:

In[2]:=
ResourceFunction["NormalLineThrough"][
 3 x/2 + 4, {x, 1}, {y, -1}, "Plot"]
Out[2]=

Compute the slope of this line:

In[3]:=
ResourceFunction["NormalLineThrough"][
 3 x/2 + 4, {x, 1}, {y, -1}, "Slope"]
Out[3]=

Compute the horizontal intercept of this line:

In[4]:=
ResourceFunction["NormalLineThrough"][
 3 x/2 + 4, {x, 1}, {y, -1}, "HorizontalIntercept"]
Out[4]=

Get the standard form equation of this line:

In[5]:=
ResourceFunction["NormalLineThrough"][
 3 x/2 + 4, {x, 1}, {y, -1}, "StandardFormEquation"]
Out[5]=

Get an Association of properties of a line normal to y=-x/2+4 that passes through the point (x,y)=(3/5,6/7):

In[6]:=
ResourceFunction["NormalLineThrough"][-x/2 + 4, {x, 3/5}, {y, 6/7}]
Out[6]=

Get just the slope-intercept equation of this line:

In[7]:=
ResourceFunction[
 "NormalLineThrough"][-x/2 + 4, {x, 3/5}, {y, 6/7}, "SlopeInterceptEquation"]
Out[7]=

Possible Issues (1) 

The first argument to NormalLineThrough must be a linear function of x:

In[8]:=
ResourceFunction["NormalLineThrough"][x^2, {x, 1}, {y, 2}]
Out[8]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 05 April 2022

Related Resources

Author Notes

To view the full source code for NormalLineThrough, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "Lines.wl"}]]

License Information