sine logic