コード例 #1
0
func Make(app RenderApplication) BigBaseNumerics {
	prec := app.Precision()

	planeMin, planeMax := app.BigUserCoords()

	left := MakeBigFloat(0.0, prec)
	right := MakeBigFloat(0.0, prec)
	top := MakeBigFloat(0.0, prec)
	bottom := MakeBigFloat(0.0, prec)

	left.Set(planeMin.Real())
	right.Set(planeMax.Real())
	bottom.Set(planeMin.Imag())
	top.Set(planeMax.Imag())

	planeWidth := MakeBigFloat(0.0, prec)
	planeWidth.Sub(&right, &left)

	planeHeight := MakeBigFloat(0.0, prec)
	planeHeight.Sub(&top, &bottom)

	baseConfig := app.BaseConfig()

	pictureWidth, pictureHeight := app.PictureDimensions()
	uq := UnitQuery{pictureWidth, pictureHeight, &planeWidth, &planeHeight}
	rUnit, iUnit := uq.PixelUnits()

	fSqrtDiverge := math.Sqrt(baseConfig.DivergeLimit)

	bbn := BigBaseNumerics{
		BaseNumerics: base.Make(app),
		RealMin:      left,
		RealMax:      right,
		ImagMin:      bottom,
		ImagMax:      top,

		SqrtDivergeLimit: MakeBigFloat(fSqrtDiverge, prec),
		IterateLimit:     baseConfig.IterateLimit,

		Runit:     rUnit,
		Iunit:     iUnit,
		Precision: prec,
	}

	return bbn
}
コード例 #2
0
func Make(app RenderApplication) NativeBaseNumerics {
	planeMin, planeMax := app.NativeUserCoords()
	planeWidth := real(planeMax) - real(planeMin)
	planeHeight := imag(planeMax) - imag(planeMin)
	pictureWidth, pictureHeight := app.PictureDimensions()
	config := app.BaseConfig()

	uq := UnitQuery{pictureWidth, pictureHeight, planeWidth, planeHeight}
	rUnit, iUnit := uq.PixelUnits()

	return NativeBaseNumerics{
		BaseNumerics: base.Make(app),
		RealMin:      real(planeMin),
		RealMax:      real(planeMax),
		ImagMin:      imag(planeMin),
		ImagMax:      imag(planeMax),

		SqrtDivergeLimit: math.Sqrt(config.DivergeLimit),
		IterateLimit:     config.IterateLimit,

		Runit: rUnit,
		Iunit: iUnit,
	}
}