Polygons
Methods
Polygon(x::Vector{Float64}, y::Vector{Float64})A polygon defined by its vertices, which must be provided in counter-clockwise order.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0])
Polygon with 4 vertices at
             (-1.0,-1.0) (0.2,-1.0) (1.0,0.5) (-1.0,1.0)
             interior angles/π = [0.5, 0.656, 0.422, 0.422]SchwarzChristoffel.Polygons.vertex — Function.vertex(p::Polygon) -> Vector{Complex128}Returns the vector of vertices of the polygon p, in complex form.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> vertex(p)
4-element Array{Complex{Float64},1}:
 -1.0-1.0im
  0.2-1.0im
  1.0+0.5im
 -1.0+1.0imSchwarzChristoffel.Polygons.interiorangle — Function.interiorangle(p::Polygon) -> Vector{Float64}Returns the vector of interior angles (divided by $\pi$) of the polygon p.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> interiorangle(p)
4-element Array{Float64,1}:
 0.5
 0.655958
 0.422021
 0.422021Base.length — Method.length(p::Polygon) -> IntegerReturns the number of vertices of the polygon p.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> length(p)
4Base.isinf — Method.isinf(p::Polygon) -> BoolReturns true if any vertex in polygon p is at infinity.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> isinf(p)
falseSchwarzChristoffel.Polygons.isinpoly — Function.isinpoly(z::Complex128,p::Polygon) -> BoolReturns true or false depending on whether z is inside or outside polygon p.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> isinpoly(0.0+0.0im,p)
true
julia> isinpoly(1.0+2.0im,p)
falseisinpoly(z::Complex128,p::Polygon,tol::Float64) -> BoolReturns true if z is inside or within distance tol of polygon p.
Example
julia> p = Polygon([-1.0,0.2,1.0,-1.0],[-1.0,-1.0,0.5,1.0]);
julia> isinpoly(-1.01+0.0im,p)
false
julia> isinpoly(-1.01+0.0im,p,1e-2)
trueSchwarzChristoffel.Polygons.naca4 — Function.naca4(cam,pos,t[;np=20][,Zc=0.0+0.0im][,len=1.0]) -> Vector{Complex128}Generates the vertices of a NACA 4-digit airfoil of chord length 1. The relative camber is specified by cam, the position of maximum camber (as fraction of chord) by pos, and the relative thickness by t.
The optional parameter np specifies the number of points on the upper or lower surface. The optional parameter Zc specifies the mean position of the vertices (which is set to the origin by default). The optional parameter len specifies the chord length.
Example
julia> w = naca4(0.0,0.0,0.12);
julia> p = Polygon(w);