Skip to content

Commit

Permalink
Config public properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Kerr committed Jul 11, 2021
1 parent 8e3a47d commit c03950d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Sources/MandelbrotEngine/MandelbrotSetConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
public struct MandelbrotSetConfig: CustomStringConvertible {
public let imageWidth: Int
public let imageHeight: Int

let width: Double
let height: Double
let centre: ComplexNumber
let iterations: Int
public let iterations: Int
public let width: Double
public let height: Double
public let centre: ComplexNumber


init(imageWidth: Int, imageHeight: Int, width: Double, height: Double, centre: ComplexNumber, iterations: Int) {
Expand All @@ -40,27 +39,27 @@ public struct MandelbrotSetConfig: CustomStringConvertible {
)
}

var xMin: Double {
public var xMin: Double {
return centre.x - width/2
}

var xMax: Double {
public var xMax: Double {
return centre.x + width/2
}

var yMin: Double {
public var yMin: Double {
return centre.y - height/2
}

var yMax: Double {
public var yMax: Double {
return centre.y + height/2
}

var dx: Double {
public var dx: Double {
return width/Double(imageWidth)
}

var dy: Double {
public var dy: Double {
return height/Double(imageHeight)
}

Expand Down

0 comments on commit c03950d

Please sign in to comment.