constant_speed_model: Constant Speed Model

View source: R/constant_speed_model.R

constant_speed_modelR Documentation

Constant Speed Model

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

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 (cm) of the hypothetical approaching attacker

start_distance

Numeric. Starting (cm) 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 (i.e. frames per second).

Value

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

See Also

looming_animation, looming_animation_calib, variable_speed_model diameter_model

Examples

loom_model <- constant_speed_model(
                     screen_distance = 20,
                     frame_rate = 60,
                     speed = 500,
                     attacker_diameter = 50,
                     start_distance = 1000)


nicholascarey/loomeR documentation built on Jan. 13, 2023, 11:31 a.m.