Wolfram Research

Function Repository Resource:

Intercepts (9.0.0) current version: 10.0.0 »

Source Notebook

Compute the intercepts of a function with the coordinate axes

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["Intercepts"][expr,{x,y,}]

finds the intercepts of the expression expr with respect to the axis variables x,y,.

ResourceFunction["Intercepts"][expr,var,x]

returns only the x-intercepts of the graph of expr.

Details and Options

The first argument expr should be an equation (having head Equal).
ResourceFunction["Intercepts"] accepts the option "Constraints", expecting a logical combination of equalities and inequalities involving the axis variables.
Results of ResourceFunction["Intercepts"][expr,{x,y},] are returned in an association of the form <|x{{x1,0},{x2,0}},y|>.

Examples

Basic Examples (3) 

Find the intercepts of a line:

In[1]:=
ResourceFunction["Intercepts"][y == 3 x + 5, {x, y}]
Out[1]=
In[2]:=
Plot[3 x + 5, {x, -3, 3}, Epilog -> Join[{Red, PointSize@Large}, Point /@ Flatten[Values[%], {1}]]]
Out[2]=

Find the intercepts of a parabola:

In[3]:=
ResourceFunction["Intercepts"][y == x^2 + 2 x - 3, {x, y}]
Out[3]=
In[4]:=
Plot[x^2 + 2 x - 3, {x, -4, 2.5}, Epilog -> Join[{Red, PointSize@Large}, Point /@ Flatten[Values[%], {1}]]
 ]
Out[4]=

Find the intercepts of an implicitly-defined circle:

In[5]:=
ResourceFunction["Intercepts", ResourceVersion->"9.0.0"][(x - 1.75)^2 + (y - 0.3)^2 == 9, {x, y}]
Out[5]=
In[6]:=
Plot[{0.3 + Sqrt[9 - (x - 1.75)^2], 0.3 - Sqrt[9 - (x - 1.75)^2]}, {x, -5, 5}, Epilog -> Join[{Red, PointSize@Large}, Point /@ Flatten[Values[%], {1}]]
 ]
Out[6]=

Scope (1) 

Intercepts[expr,] can handle the use of symbolic parameters in expr:

In[7]:=
ResourceFunction["Intercepts"][x^2 + a y^2 == 9, {x, y}]
Out[7]=

Options (2) 

Use the "Constraints" option to restrict the results returned:

In[8]:=
ResourceFunction["Intercepts"][x^2 + y^2 == 1, {x, y}, "Constraints" -> x >= 0]
Out[8]=

With the default setting "Constraints" True, all results are included:

In[9]:=
ResourceFunction["Intercepts"][x^2 + y^2 == 1, {x, y}]
Out[9]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 10.0.0 – 23 March 2023
  • 9.0.0 – 20 August 2020
  • 8.0.0 – 24 January 2020
  • 7.0.0 – 06 September 2019
  • 6.0.0 – 12 June 2019
  • 5.0.0 – 11 June 2019
  • 4.0.0 – 11 June 2019
  • 3.0.0 – 11 June 2019
  • 2.0.0 – 11 June 2019
  • 1.0.0 – 01 February 2019

Related Resources

Author Notes

To view the full source code for Intercepts, run the following code:

FileNameJoin[ReplacePart[FileNameSplit[FindFile["ResourceFunctionHelpers`"]], -1 "Intercepts.wl"]] // SystemOpen

License Information