Coordinates

Coordinates

MolecularGraph.coordgenMethod
coordgen(mol::MolGraph) -> Tuple{Array{Int,1},Array{Int,1}}

Generate 2D coordinates by using Schrodinger's coordgenlibs.

This will returns a tuple of coords and styles arrays. coords is a size(n, 2) matrix where n is atom count, which stores 2D coordinates (x, y) of each atoms. styles is a size e vector of wedge notation of stereobond, where e is bond count.

source

Geometry basics

MolecularGraph.distanceMethod
distance(u::MGPoint, v::MGPoint) -> Float64
distance(s::Segment) -> Float64
distance(coords::AbstractMatrix{T}) where {T<:Real} -> Float64

Return distance between two endpoints.

source
MolecularGraph.isclockwiseMethod
isclockwise(vertices::AbstractMatrix{Float64}) -> Union{Bool,Nothing}

Return true/false if given vertices of a polygon in 2D space are placed clockwise/anticlockwise. Return nothing if the polygon is self-intersecting or some vertices are overlapped.

source
MolecularGraph.midpointMethod
midpoint(u::MGPoint, v::MGPoint) -> MGPoint
midpoint(s::Segment) -> MGPoint
midpoint(coords::AbstractMatrix{T}) where {T<:Real} -> AbstractMatrix

Return the midpoint of u and v.

source
MolecularGraph.unitvectorMethod
unitvector(u::MGPoint, v::MGPoint) -> MGPoint
unitvector(s::Segment) -> MGPoint
unitvector(coords::AbstractMatrix{T}) where {T<:Real} -> AbstractMatrix

Return u -> v vector of length 1.

source