Sha256: 7f0da00cdc61b5382e9f541689f0bec1e3c5d944a7fc32a7ab6c529d176e00f8

Contents?: true

Size: 508 Bytes

Versions: 7

Compression:

Stored size: 508 Bytes

Contents

module Danica
  class Function::Spatial < Function.build(:time, :acceleration, :initial_space, :initial_velocity) { addition(parcels) }

    private

    def parcels
      [
        initial_space,
        spatial_velocity,
        spatial_acceleration
      ]
    end

    def spatial_velocity
      multiplication(initial_velocity, time)
    end

    def spatial_acceleration
      division(multiplication(acceleration, time_squared), 2)
    end

    def time_squared
      power(time, 2)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
danica-2.4.4 spec/support/models/functions/spatial.rb
danica-2.4.3 spec/support/models/functions/spatial.rb
danica-2.4.2 spec/support/models/functions/spatial.rb
danica-2.4.1 spec/support/models/functions/spatial.rb
danica-2.4.0 spec/support/models/functions/spatial.rb
danica-2.3.1 spec/support/models/functions/spatial.rb
danica-2.3.0 spec/support/models/functions/spatial.rb