constant_speed_model: Constant Speed Model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/constant_speed_model.R

Description

Given a viewing distance, this function calculates the on-screen diameters of a hypothetical object of defined size approaching at a constant speed. This allows a looming animation with precise parameters to be created.

Usage

1
2
constant_speed_model(screen_distance = 20, frame_rate = 60,
  speed = 500, attacker_diameter = 50, start_distance = 1000)

Arguments

screen_distance

numeric. Distance (cm) from the playback screen to your specimen.

frame_rate

numeric. Frames per second (Hz) you want the resulting animation to be.

speed

numeric. Speed (cm/s) of the hypothetical approaching attacker.

attacker_diameter

numeric. Diameter of the hypothetical approaching attacker

start_distance

numeric. Starting distance of the hypothetical approaching attacker

Details

Calculates the screen diameters for a modelled object of specified size approaching at a constant speed, from a specified distance away. The output list object can be used to create a looming animation in looming_animation. An object screen diameter is calculated for each frame from the specified starting distance until the hypothetical distance between the attacker and target is zero.

Requires the frame rate at which the subsequent animation will be played, and distance from the screen at which the observing specimen will be located. These details are important in experiments where you want to precisely determine at what time, perceived distance, or perceived velocity of an attack an escape response occurs. Note: if the specimen is closer or further away than the specified screen distance, the animation will be perceived as a different distance and a different velocity.

If you need to create a looming animation simply to elicit a response, and are not concerned with the precise details, see diameter_model.

Inputs should be in cm, speed in cm/s, and frame rate in Hz or Frames per Second.

Value

List object containing the input parameters and the resulting diameter for each frame in the animation.

Author(s)

Nicholas Carey - [email protected]

See Also

looming_animation, looming_animation_calib, variable_speed_model diameter_model

Examples

1
2
3
4
5
6
loom_model <- constant_speed_model(
                     screen_distance = 20,
                     frame_rate = 60,
                     speed = 500,
                     attacker_diameter = 50,
                     start_distance = 1000)

nicholascarey/loomeR documentation built on July 15, 2019, 7:54 a.m.