Documentation ¶
Index ¶
- Constants
- func GenBrace(scope Scope, x float64, y float64, h float64, flipX bool, ctx context.Context) (boundingbox.BB, error)
- func GenContourPath(scope Scope, x float64, y float64, h float64, ctx context.Context) (boundingbox.BB, error)
- func GenIntegralPath(scope Scope, x float64, y float64, h float64, ctx context.Context) (boundingbox.BB, error)
- func GenLeftBrace(scope Scope, x float64, y float64, h float64, ctx context.Context) (boundingbox.BB, error)
- func GenRightBrace(scope Scope, x float64, y float64, h float64, ctx context.Context) (boundingbox.BB, error)
- func GenSumPath(scope Scope, x float64, y float64, w float64, h float64, ctx context.Context) (boundingbox.BB, error)
- func IsFloat(t Token) bool
- func IsSymbol(t Token) bool
- func IsWord(t Token) bool
- func MergeContexts(ts ...Token) context.Context
- type Add
- type Align
- type Approx
- type BinSymbolOp
- type BinaryOp
- type CSV
- type Call
- type Div
- type Dot
- type DumpableData
- type Equals
- type Float
- type Frac
- type GE
- type GT
- type Group
- type IfElse
- type Index
- type Integral
- type LE
- type LT
- type LevelScope
- type LevelScopeData
- type Mul
- type NE
- type Neg
- type Parens
- type Pow
- type PreSymbolOp
- type RightArrow1
- type RightArrow2
- type Root
- type Scope
- type Sub
- type SubScope
- type Sum
- type Symbol
- type Token
- func NewAddOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewApproxOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewBinSymbolOp(left, right float64, symbol *Symbol, a, b Token, ctx context.Context) (Token, error)
- func NewBinaryOp(name string, a Token, b Token, ctx context.Context) (Token, error)
- func NewCSV(args []Token, ctx context.Context) (Token, error)
- func NewCall(name string, args []Token, ctx context.Context) (Token, error)
- func NewDivOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewDot(a Token, ctx context.Context) (Token, error)
- func NewEqualsOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewGEOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewGTOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewGroup(content []Token, sepStr string, ctx context.Context) (Token, error)
- func NewIndexOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewLEOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewLTOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewNEOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewNegOp(a Token, ctx context.Context) (Token, error)
- func NewParens(content Token, ctx context.Context) (Token, error)
- func NewPostUnaryOp(name string, a Token, ctx context.Context) (Token, error)
- func NewPowOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewPreUnaryOp(name string, a Token, ctx context.Context) (Token, error)
- func NewRightArrow1(a Token, b Token, ctx context.Context) (Token, error)
- func NewRightArrow2(a Token, b Token, ctx context.Context) (Token, error)
- func NewRoot(a Token, b Token, ctx context.Context) (Token, error)
- func NewSubOp(a Token, b Token, ctx context.Context) (Token, error)
- func NewValueWord(value string, ctx context.Context) (Token, error)
- func NewWord(value string, ctx context.Context) (Token, error)
- type TokenData
- type UnaryOp
- type Word
Constants ¶
View Source
const ( BRACE_X0 = 0.00002 BRACE_Y0 = 0.0 BRACE_X01A = 0.0335 BRACE_Y01A = -0.0105 BRACE_X01B = 0.056 BRACE_Y01B = -0.0229 BRACE_X1 = 0.06702 BRACE_Y1 = -0.038 BRACE_X12A = 0.0795 BRACE_Y12A = -0.0531 BRACE_X12B = 0.08502 BRACE_Y12B = -0.0784 BRACE_X2 = 0.08502 BRACE_Y2 = -0.1275 BRACE_X3 = 0.08502 BRACE_Y3 = -0.291 BRACE_X34A = 0.08502 BRACE_Y34A = -0.3206 BRACE_X34B = 0.0887 BRACE_Y34B = -0.3434 BRACE_X4 = 0.09502 BRACE_Y4 = -0.362 BRACE_X45A = 0.1016 BRACE_Y45A = -0.3806 BRACE_X45B = 0.1121 BRACE_Y45B = -0.3949 BRACE_X5 = 0.12802 BRACE_Y5 = -0.404 BRACE_X56A = 0.1434 BRACE_Y56A = -0.4137 BRACE_X56B = 0.1602 BRACE_Y56B = -0.4208 BRACE_X6 = 0.17802 BRACE_Y6 = -0.424 BRACE_X67A = 0.1966 BRACE_Y67A = -0.4269 BRACE_X67B = 0.2201 BRACE_Y67B = -0.4290 BRACE_X7 = 0.25002 BRACE_Y7 = -0.43 BRACE_X8 = 0.25002 BRACE_Y8 = -0.419 BRACE_X89A = 0.2153 BRACE_Y89A = -0.419 BRACE_X89B = 0.1917 BRACE_Y89B = -0.3965 BRACE_X9 = 0.17802 BRACE_Y9 = -0.379 BRACE_X910A = 0.1654 BRACE_Y910A = -0.3610 BRACE_X910B = 0.15902 BRACE_Y910B = -0.3333 BRACE_X10 = 0.15902 BRACE_Y10 = -0.291 BRACE_X11 = 0.15902 BRACE_Y11 = -0.1275 BRACE_X1112A = 0.15902 BRACE_Y1112A = -0.0866 BRACE_X1112B = 0.1527 BRACE_Y1112B = -0.0577 BRACE_X12 = 0.1415 BRACE_Y12 = -0.0388 BRACE_X1213A = 0.1273 BRACE_Y1213A = -0.0226 BRACE_X1213B = 0.1024 BRACE_Y1213B = -0.0087 BRACE_X13 = 0.06502 BRACE_Y13 = 0.0 )
View Source
const ( GROUP_SEP_LEFT_SPACING = 0.05 GROUP_SEP_RIGHT_SPACING = 0.1 )
View Source
const ( INT_X0 = 0.00001 INT_Y0 = 0.00001 INT_X01A = 0.0001 INT_Y01A = -0.0613 INT_X01B = 0.0162 INT_Y01B = -0.1146 INT_X1 = 0.04901 INT_Y1 = -0.15999 INT_X12A = 0.0825 INT_Y12A = -0.2061 INT_X12B = 0.1260 INT_Y12B = -0.22899 INT_X2 = 0.18001 // top most point INT_Y2 = -0.22899 INT_X23A = 0.2095 INT_Y23A = -0.22899 INT_X23B = 0.2350 INT_Y23B = -0.2216 INT_X3 = 0.25701 INT_Y3 = -0.20599 INT_X34A = 0.2794 INT_Y34A = -0.1903 INT_X34B = 0.2920 INT_Y34B = -0.1698 INT_X4 = 0.2920 // right-most point INT_Y4 = -0.1442 INT_X45A = 0.2920 INT_Y45A = -0.1306 INT_X45B = 0.2868 INT_Y45B = -0.1204 INT_X5 = 0.27801 INT_Y5 = -0.11299 INT_X56A = 0.2704 INT_Y56A = -0.1062 INT_X56B = 0.2602 INT_Y56B = -0.10299 INT_X6 = 0.24901 INT_Y6 = -0.10299 INT_X67A = 0.2381 INT_Y67A = -0.10299 INT_X67B = 0.2277 INT_Y67B = -0.1061 INT_X7 = 0.21901 INT_Y7 = -0.11299 INT_X78A = 0.2114 INT_Y78A = -0.12 INT_X78B = 0.20701 INT_Y78B = -0.1304 INT_X8 = 0.20701 INT_Y8 = -0.14399 INT_X89A = 0.20701 INT_Y89A = -0.1558 INT_X89B = 0.2112 INT_Y89B = -0.1658 INT_X9 = 0.21801 INT_Y9 = -0.17299 INT_X910A = 0.2254 INT_Y910A = -0.18 INT_X910B = 0.2344 INT_Y910B = -0.1844 INT_X10 = 0.24501 // inflection point INT_Y10 = -0.18599 INT_X1011A = 0.2278 INT_Y1011A = -0.1997 INT_X1011B = 0.2060 INT_Y1011B = -0.20699 INT_X11 = 0.18001 INT_Y11 = -0.20699 INT_X1112A = 0.1154 INT_Y1112A = -0.20699 INT_X1112B = 0.08301 INT_Y1112B = -0.138 INT_X12 = 0.08301 INT_Y12 = 0.00001 INT_Y13 = 0.64201 // for the height of the straight part INT_X0_NEXT = 0.35001 // for the space between two integrals )
View Source
const ( INT_CONTOUR_INNER_R = 0.249 INT_CONTOUR_OUTER_R = 0.274 )
contour related
View Source
const ( INT_HOR_D_SPACING = 0.1 INT_HOR_S_SPACING = 0.1 INT_BOUND_SPACING = 0.05 INT_VER_CENTER = plusMinusFracYOffset - 0.5*lineThickness )
metrics
View Source
const ( PARENS_X0 = 0.00047 PARENS_Y0 = -0.00205 PARENS_X01A = 0.00047 PARENS_Y01A = -0.0496 PARENS_X01B = 0.0071 PARENS_Y01B = -0.0955 PARENS_X1 = 0.01847 PARENS_Y1 = -0.13805 PARENS_X12A = 0.0311 PARENS_Y12A = -0.1816 PARENS_X12B = 0.0456 PARENS_Y12B = -0.2173 PARENS_X2 = 0.06247 PARENS_Y2 = -0.24505 PARENS_X23A = 0.0795 PARENS_Y23A = -0.2738 PARENS_X23B = 0.1003 PARENS_Y23B = -0.3011 PARENS_X3 = 0.12547 PARENS_Y3 = -0.32705 PARENS_X34A = 0.1513 PARENS_Y34A = -0.3542 PARENS_X34B = 0.1725 PARENS_Y34B = -0.3734 PARENS_X4 = 0.18947 PARENS_Y4 = -0.38605 PARENS_X45A = 0.2062 PARENS_Y45A = -0.3991 PARENS_X45B = 0.2257 PARENS_Y45B = -0.4122 PARENS_X5 = 0.24747 PARENS_Y5 = -0.42605 PARENS_X6 = 0.25647 PARENS_Y6 = -0.41005 PARENS_X67A = 0.2269 PARENS_Y67A = -0.3863 PARENS_X67B = 0.2034 PARENS_Y67B = -0.3641 PARENS_X7 = 0.1870 PARENS_Y7 = -0.34505 PARENS_X78A = 0.1675 PARENS_Y78A = -0.3256 PARENS_X78B = 0.1503 PARENS_Y78B = -0.3005 PARENS_X8 = 0.13347 PARENS_Y8 = -0.26905 PARENS_X89A = 0.1167 PARENS_Y89A = -0.2384 PARENS_X89B = 0.1047 PARENS_Y89B = -0.2015 PARENS_X9 = 0.09747 PARENS_Y9 = -0.15805 PARENS_X910A = 0.0902 PARENS_Y910A = -0.1155 PARENS_X910B = 0.08647 PARENS_Y910B = -0.0640 PARENS_X10 = 0.08647 PARENS_Y10 = -0.00205 // change to 0 )
View Source
const ( ROOT_X0 = 0.0 ROOT_Y0 = -0.47921 ROOT_X1 = 0.02718 ROOT_Y1 = -0.42137 ROOT_X2 = 0.12247 ROOT_Y2 = -0.46849 ROOT_X3 = 0.37698 ROOT_Y3 = 0.0 ROOT_X4 = 0.35201 ROOT_Y4 = -0.24255 ROOT_X5 = 0.16953 ROOT_Y5 = -0.56133 // in radians ROOT_ANGLE = 0.16071 ROOT_THICKNESS = 0.0642 ROOT_VER_SPACING = 0.1 ROOT_HOR_SPACING = 0.1 ROOT_LEFT_PADDING = 0.1 )
the first 6 points of the root, relative to the left bottom
View Source
const ( SUM_X0 = 0.00001 SUM_Y0 = 0.00003 SUM_X1 = 0.24201 SUM_Y1 = -0.40797 SUM_X2 = 0.00901 SUM_Y2 = -0.87497 SUM_X3 = 0.60801 SUM_Y3 = -0.87497 SUM_X4 = 0.61801 SUM_Y4 = -0.70997 SUM_X5 = 0.59201 SUM_Y5 = -0.70997 SUM_X56A = 0.5873 SUM_Y56A = -0.7346 SUM_X56B = 0.5827 SUM_Y56B = -0.7533 SUM_X6 = 0.57801 SUM_Y6 = -0.7635 SUM_X67A = 0.5734 SUM_Y67A = -0.7793 SUM_X67B = 0.5654 SUM_Y67B = -0.7916 SUM_X7 = 0.55401 SUM_Y7 = -0.80297 SUM_X78A = 0.5434 SUM_Y78A = -0.8150 SUM_X78B = 0.5280 SUM_Y78B = -0.8230 SUM_X8 = 0.5094 SUM_Y8 = -0.8237 SUM_X89A = 0.4887 SUM_Y89A = -0.8316 SUM_X89B = 0.4627 SUM_Y89B = -0.8340 SUM_X9 = 0.43001 SUM_Y9 = -0.83397 SUM_X10 = 0.16201 SUM_Y10 = -0.83397 SUM_X11 = 0.35001 SUM_Y11 = -0.46397 SUM_X12 = 0.14901 SUM_Y12 = -0.11197 SUM_X13 = 0.47701 SUM_Y13 = -0.11197 SUM_X1314A = 0.5343 SUM_Y1314A = -0.1120 SUM_X1314B = 0.5740 SUM_Y1314B = -0.1180 SUM_X14 = 0.59601 SUM_Y14 = -0.12997 SUM_X1415A = 0.6187 SUM_Y1415A = -0.1426 SUM_X1415B = 0.6383 SUM_Y1415B = -0.1693 SUM_X15 = 0.65501 SUM_Y15 = -0.20997 SUM_X16 = 0.68101 SUM_Y16 = -0.20997 SUM_X17 = 0.62701 SUM_Y17 = 0.00003 )
View Source
const ( SUM_HOR_SPACING = 0.1 SUM_VER_SPACING = 0.1 SUM_LOWER_UPPER_SCALE = 0.6 )
Variables ¶
This section is empty.
Functions ¶
func GenContourPath ¶
func GenContourPath(scope Scope, x float64, y float64, h float64, ctx context.Context) (boundingbox.BB, error)
same inputs as integral path!
func GenIntegralPath ¶
func GenLeftBrace ¶
func GenRightBrace ¶
func GenSumPath ¶
func GenSumPath(scope Scope, x float64, y float64, w float64, h float64, ctx context.Context) (boundingbox.BB, error)
simply vertical scaling is ugly, we must keep the angle
func MergeContexts ¶
Types ¶
type Align ¶
type Align struct { TokenData // contains filtered or unexported fields }
func (*Align) GenerateTags ¶
type Approx ¶
type Approx struct {
BinSymbolOp
}
type BinSymbolOp ¶
type BinSymbolOp struct { BinaryOp // contains filtered or unexported fields }
func (*BinSymbolOp) GenerateTags ¶
func (t *BinSymbolOp) GenerateTags(scope Scope, x float64, y float64) (boundingbox.BB, error)
type CSV ¶
type CSV struct { TokenData // contains filtered or unexported fields }
func (*CSV) GenerateTags ¶
type Call ¶
type Call struct { TokenData // contains filtered or unexported fields }
func (*Call) GenerateTags ¶
type Div ¶
type Div struct {
BinSymbolOp
}
type DumpableData ¶
type DumpableData struct {
// contains filtered or unexported fields
}
func NewDumpableData ¶
func NewDumpableData(name string) DumpableData
func (*DumpableData) Dump ¶
func (t *DumpableData) Dump(indent string) string
type GE ¶
type GE struct {
BinSymbolOp
}
type GT ¶
type GT struct {
BinSymbolOp
}
type Group ¶
type Group struct { TokenData // contains filtered or unexported fields }
func (*Group) GenerateTags ¶
type IfElse ¶
type IfElse struct { TokenData // contains filtered or unexported fields }
func (*IfElse) GenerateTags ¶
type Integral ¶
type Integral struct { TokenData // contains filtered or unexported fields }
func NewContourIntegral ¶
func NewIntegral ¶
func (*Integral) GenerateTags ¶
type LE ¶
type LE struct {
BinSymbolOp
}
type LT ¶
type LT struct {
BinSymbolOp
}
type LevelScope ¶
type LevelScope interface { Level() float64 FracDepth() int Scale(f float64) LevelScope IncrFracDepth() LevelScope }
func NewLevelScope ¶
func NewLevelScope() LevelScope
type LevelScopeData ¶
type LevelScopeData struct {
// contains filtered or unexported fields
}
func (*LevelScopeData) FracDepth ¶
func (l *LevelScopeData) FracDepth() int
func (*LevelScopeData) IncrFracDepth ¶
func (l *LevelScopeData) IncrFracDepth() LevelScope
func (*LevelScopeData) Level ¶
func (l *LevelScopeData) Level() float64
func (*LevelScopeData) Scale ¶
func (l *LevelScopeData) Scale(f float64) LevelScope
type NE ¶
type NE struct {
BinSymbolOp
}
type Neg ¶
type Neg struct {
PreSymbolOp
}
type Parens ¶
type Parens struct { TokenData // contains filtered or unexported fields }
func (*Parens) GenerateTags ¶
type PreSymbolOp ¶
type PreSymbolOp struct { UnaryOp // contains filtered or unexported fields }
func (*PreSymbolOp) GenerateTags ¶
func (t *PreSymbolOp) GenerateTags(scope Scope, x float64, y float64) (boundingbox.BB, error)
type RightArrow1 ¶
type RightArrow1 struct {
BinSymbolOp
}
type RightArrow2 ¶
type RightArrow2 struct {
BinSymbolOp
}
type Root ¶
type Root struct {
BinaryOp // XXX: second argument is ignored for now
}
func (*Root) GenerateTags ¶
type SubScope ¶
type SubScope interface { Scope // first offset, then scale Transform(xOffset float64, yOffset float64, xScale float64, yScale float64) }
new subscope starts at xOffset = 0, yOffset = 0, xScale = 1, yScale = 1
type Sum ¶
type Sum struct { TokenData // contains filtered or unexported fields }
func (*Sum) GenerateTags ¶
type Symbol ¶
type Symbol struct { Word // contains filtered or unexported fields }
func NewUnicodeSymbol ¶
func (*Symbol) GenerateTags ¶
dont take advance width into account (rely on operator spacing)
type Token ¶
type Token interface { Dump(indent string) string // to inspect the syntax-tree Context() context.Context GenerateTags(scope Scope, x float64, y float64) (boundingbox.BB, error) }
func NewBinSymbolOp ¶
func NewBinaryOp ¶
type Word ¶
type Word struct { TokenData // contains filtered or unexported fields }
func (*Word) GenerateTags ¶
Source Files ¶
- Add.go
- Align.go
- Approx.go
- BinSymbolOp.go
- Brace.go
- CSV.go
- Call.go
- Div.go
- Dot.go
- Equals.go
- Float.go
- Frac.go
- GE.go
- GT.go
- Group.go
- IfElse.go
- Index.go
- Integral.go
- LE.go
- LT.go
- LevelScope.go
- Mul.go
- NE.go
- Neg.go
- Parens.go
- Pow.go
- PreSymbolOp.go
- RightArrow.go
- Root.go
- Scope.go
- Sub.go
- Sum.go
- Symbol.go
- Token.go
- Word.go
- metrics.go
- operators.go
Click to show internal directories.
Click to hide internal directories.