xyAngle: Get angle from origin to vector of x,y coordinates

xyAngleR Documentation

Get angle from origin to vector of x,y coordinates

Description

Get angle from origin to vector of x,y coordinates

Usage

xyAngle(
  x,
  y = NULL,
  directed = FALSE,
  deg = TRUE,
  origin.x = 0,
  origin.y = 0,
  ...
)

Arguments

x

numeric vector or two-column matrix with columns representing x,y coordinates when y is NULL.

y

numeric vector or NULL.

directed

logical indicating whether to return angles around the full circle, or only half circle. For example, in degrees c(1,1) indicates 45 degrees, c(-1,-1) indicates -135 degrees. When directed=FALSE then c(-1,-1) indicates 45 degrees.

deg

logical indicating whether to return degrees, or when deg=FALSE it returns radians.

origin.x, origin.y

numeric input defining the coordinates to use as the origin. When non-zero it implies the first point of each segment.

...

additional arguments are ignored.

Details

This function gets the angle from origin to x,y coordinates, allowing for vectorized input and output.

See Also

Other jam utility functions: avg_angles(), avg_colors_by_list(), call_fn_ellipsis_deprecated(), cell_fun_bivariate(), collapse_mem_clusters(), colorRamp2D(), deconcat_df2(), display_colorRamp2D(), enrichList2geneHitList(), filter_mem_genes(), filter_mem_sets(), find_colname(), get_hull_data(), get_igraph_layout(), gsubs_remove(), handle_igraph_param_list(), isColorBlank(), make_legend_bivariate(), make_point_hull(), mem_find_overlap(), order_colors(), rank_mem_clusters(), rotate_coordinates(), subgraph_jam(), subset_mem(), summarize_node_spacing()

Examples

# by default output is in degrees
xyAngle(1, 1);

# output in radians
xyAngle(1, 1, deg=FALSE);

# optionally different origin
xyAngle(1, 1, origin.x=1, origin.y=0);


jmw86069/multienrichjam documentation built on Nov. 3, 2024, 10:29 p.m.