vc_plot_vector_field: Display stored field arrows and an optional trajectory

View source: R/vector_fields.R

vc_plot_vector_fieldR Documentation

Display stored field arrows and an optional trajectory

Description

Display stored field arrows and an optional trajectory

Usage

vc_plot_vector_field(result, streamline = NULL, scale = NULL, title = NULL)

Arguments

result

Result of vc_vector_field_sample().

streamline

Optional vc_streamline() result.

scale

Positive maximum arrow length in Cartesian units. By default uses eight percent of the largest sampled axis span.

title

Optional plot title.

Value

Plotly widget using stored positions and vectors. Arrow lengths are proportional to magnitude and zero vectors are shown as points.

Examples

if (requireNamespace("plotly",quietly=TRUE)) {
  f <- function(p)c(-p[2],p[1],0)
  s <- vc_vector_field_sample(f,function(x)-1,function(x)1,
    function(p)0,function(p)0,c(-1,1),n=4,n_u=4,n_v=1)
  vc_plot_vector_field(s,vc_streamline(f,c(1,0,0),c(0,pi)))
}

vectorialcalculus documentation built on Nov. 17, 2026, 1:09 a.m.