Skip to contents

Plots the Morse-Smale complex with emphasis on critical point structure. Shows contour lines, critical points (maxima as red triangles, minima as blue triangles, saddles as green diamonds), and optionally the separatrices emanating from saddle points.

Usage

morse.smale.complex.plot.from.critical(
  critical_points,
  mixture,
  grid,
  show_separatrices = TRUE,
  ...
)

Arguments

critical_points

List containing:

  • maxima: Matrix of maximum coordinates (n x 2)

  • minima: Matrix of minimum coordinates (n x 2)

  • saddles: Matrix of saddle point coordinates (n x 2)

mixture

Object containing:

  • f: Function taking (x, y) and returning scalar value

  • gradient: Function taking (x, y) and returning gradient vector c(dx, dy)

grid

Grid object created by create.grid for function evaluation

show_separatrices

Logical, whether to compute and show separatrices from saddle points

...

Additional arguments passed to function.contours.plot

Value

Invisible NULL

Examples

if (FALSE) { # \dontrun{
# Example with known critical points
grid <- create.grid(50)
mixture <- list(
  f = function(x, y) x^2 - y^2,  # Simple saddle
  gradient = function(x, y) c(2*x, -2*y)
)
critical_points <- list(
  maxima = matrix(c(0.8, 0.2), nrow = 1),
  minima = matrix(c(0.2, 0.8), nrow = 1),
  saddles = matrix(c(0.5, 0.5), nrow = 1)
)
morse.smale.complex.plot.from.critical(critical_points, mixture, grid)
} # }