newpoint: Coordinates of point on ray Used in the function...

View source: R/DAPC_adegenet.R

newpointR Documentation

Coordinates of point on ray Used in the function ggscatter.dapc to control segments radiating from cluster centers towards individual's pca coordinates. Returns x,y coordinates of a point (p2) on a ray with origin at p0(x0,y0) and another point at p1(x1,y1), such that the distance from p0 to p2 = c*(distance from p0 to p1).

Description

Coordinates of point on ray

Used in the function ggscatter.dapc to control segments radiating from cluster centers towards individual's pca coordinates. Returns x,y coordinates of a point (p2) on a ray with origin at p0(x0,y0) and another point at p1(x1,y1), such that the distance from p0 to p2 = c*(distance from p0 to p1).

Usage

newpoint(p0, p1, c)

Arguments

p0

Numberical vector with coordinates c(x0,y0) defining the origin of a ray

p1

Numberical vector with coordinates c(x1,y1) defining a point on the ray other than the origin.

c

A number equal to (distance p0 to p2)/(distance p0 to p1)

Value

Numberical vector with coordinates c(x2,y2) of p2.


JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.