Sponsored Content
Top Forums Programming "lvalue required as left operand of assignment" error in C Post 302577046 by JohnGraham on Monday 28th of November 2011 05:39:24 AM
Old 11-28-2011
How are point1, point2 and randStart declared?

Also, as agma points out, it looks like you are confusing assignment and comparison:

Code:
// '=' assigns x the value 3
x = 3;

// '==' tests if x has the value 3
if (x == 3)
    /* ... */

This User Gave Thanks to JohnGraham For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Avoid "++ requires lvalue" Error in Loop Calculation

Hi All, Please help me to perform sum of values in a loop, I am getting following error: "total=0++432907765772: ++ requires lvalue" where actual statement is as : total=$total+$amt where amt can have +ve or -ve values Thanks Sandeepb (3 Replies)
Discussion started by: sandeepb
3 Replies

2. Solaris

sendmail "root... User address required." error

I'm running sendmail (8.13.8+Sun/8.13.8/Submit) solaris 10. When I send mail to root at the command line (whether I use a full-qualified address or just root), I get the error message root... User address required. Sending mail to root (either at the command line or in a cron job),... (10 Replies)
Discussion started by: csgonan
10 Replies

3. Programming

Need help compiling in C: lvalue required as left operand of assignment

Hi, I am trying to compile a program (not coded by me), and i'm getting this error: 203: error: lvalue required as left operand of assignment As you may be guessing, the program doesn't compile, the line number 203 is the following: ... (2 Replies)
Discussion started by: Zykl0n-B
2 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

> 5 ")syntax error: operand expected (error token is " error

im kinda new to shell scripting so i need some help i try to run this script and get the error code > 5 ")syntax error: operand expected (error token is " the code for the script is #!/bin/sh # # script to see if the given value is correct # # Define errors ER_AF=86 # Var is... (4 Replies)
Discussion started by: metal005
4 Replies

6. Shell Programming and Scripting

operand expected (error token is "<")

Hi, i am getting error from below script. Error: s1.sh: line 19: ((: j<: syntax error: operand expected (error token is "<") #!/bin/bash str=$(ps -eaf | grep smon | grep -v grep | awk ' {print $8}' | cut -c10-18) i=1 while do temp=`echo $str|awk '{print $"'$i'"}'` ... (12 Replies)
Discussion started by: lakshmikanthe
12 Replies

7. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

8. Programming

lvalue required as left operand of assignment

z < 0 ? z= z + 2*r*cos(theta) : z= z - 2*r*cos(theta); Does anyone know what is wrong here? I've got compiler msg: lvalue required as left operand of assignment All variables are "double". I'm using gcc compiler (but I don't think that matters) (5 Replies)
Discussion started by: EmilyTheStrange
5 Replies

9. Homework & Coursework Questions

Compiler error "lvalue required as left operand of assignment"

1. After trying to compile code error is given Lvalue required as left operand of assignment. 2. Relevant commands, code, scripts, algorithms: if , else if 3. The attempts at a solution (include all code and scripts): /* File: incircles.cpp Created by: James Selhorst ... (2 Replies)
Discussion started by: c++newb
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
math::geometry(3tcl)						 Tcl Math Library					      math::geometry(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
math::geometry - Geometrical computations SYNOPSIS
package require Tcl ?8.3? package require math::geometry ?1.1.2? ::math::geometry::+ point1 point2 ::math::geometry::- point1 point2 ::math::geometry::p x y ::math::geometry::distance point1 point2 ::math::geometry::length point ::math::geometry::s* factor point ::math::geometry::direction angle ::math::geometry::h length ::math::geometry::v length ::math::geometry::between point1 point2 s ::math::geometry::octant point ::math::geometry::rect nw se ::math::geometry::nwse rect ::math::geometry::angle line ::math::geometry::calculateDistanceToLine P line ::math::geometry::calculateDistanceToLineSegment P linesegment ::math::geometry::calculateDistanceToPolyline P polyline ::math::geometry::findClosestPointOnLine P line ::math::geometry::findClosestPointOnLineSegment P linesegment ::math::geometry::findClosestPointOnPolyline P polyline ::math::geometry::lengthOfPolyline polyline ::math::geometry::movePointInDirection P direction dist ::math::geometry::lineSegmentsIntersect linesegment1 linesegment2 ::math::geometry::findLineSegmentIntersection linesegment1 linesegment2 ::math::geometry::findLineIntersection line1 line2 ::math::geometry::polylinesIntersect polyline1 polyline2 ::math::geometry::polylinesBoundingIntersect polyline1 polyline2 granularity ::math::geometry::intervalsOverlap y1 y2 y3 y4 strict ::math::geometry::rectanglesOverlap P1 P2 Q1 Q2 strict ::math::geometry::bbox polyline ::math::geometry::pointInsidePolygon P polyline ::math::geometry::rectangleInsidePolygon P1 P2 polyline ::math::geometry::areaPolygon polygon _________________________________________________________________ DESCRIPTION
The math::geometry package is a collection of functions for computations and manipulations on two-dimensional geometrical objects, such as points, lines and polygons. The geometrical objects are implemented as plain lists of coordinates. For instance a line is defined by a list of four numbers, the x- and y-coordinate of a first point and the x- and y-coordinates of a second point on the line. The various types of object are recognised by the number of coordinate pairs and the context in which they are used: a list of four ele- ments can be regarded as an infinite line, a finite line segment but also as a polyline of one segment and a point set of two points. Currently the following types of objects are distinguished: o point - a list of two coordinates representing the x- and y-coordinates respectively. o line - a list of four coordinates, interpreted as the x- and y-coordinates of two distinct points on the line. o line segment - a list of four coordinates, interpreted as the x- and y-coordinates of the first and the last points on the line seg- ment. o polyline - a list of an even number of coordinates, interpreted as the x- and y-coordinates of an ordered set of points. o polygon - like a polyline, but the implicit assumption is that the polyline is closed (if the first and last points do not coincide, the missing segment is automatically added). o point set - again a list of an even number of coordinates, but the points are regarded without any ordering. PROCEDURES
The package defines the following public procedures: ::math::geometry::+ point1 point2 Compute the sum of the two vectors given as points and return it. The result is a vector as well. ::math::geometry::- point1 point2 Compute the difference (point1 - point2) of the two vectors given as points and return it. The result is a vector as well. ::math::geometry::p x y Construct a point from its coordinates and return it as the result of the command. ::math::geometry::distance point1 point2 Compute the distance between the two points and return it as the result of the command. This is in essence the same as math::geometry::length [math::geomtry::- point1 point2] ::math::geometry::length point Compute the length of the vector and return it as the result of the command. ::math::geometry::s* factor point Scale the vector by the factor and return it as the result of the command. This is a vector as well. ::math::geometry::direction angle Given the angle in degrees this command computes and returns the unit vector pointing into this direction. The vector for angle == 0 points to the right (up), and for angle == 90 up (north). ::math::geometry::h length Returns a horizontal vector on the X-axis of the specified length. Positive lengths point to the right (east). ::math::geometry::v length Returns a vertical vector on the Y-axis of the specified length. Positive lengths point down (south). ::math::geometry::between point1 point2 s Compute the point which is at relative distance s between the two points and return it as the result of the command. A relative dis- tance of 0 returns point1, the distance 1 returns point2. Distances < 0 or > 1 extrapolate along the line between the two point. ::math::geometry::octant point Compute the octant of the circle the point is in and return it as the result of the command. The possible results are [1] east [2] northeast [3] north [4] northwest [5] west [6] southwest [7] south [8] southeast Each octant is the arc of the circle +/- 22.5 degrees from the cardinal direction the octant is named for. ::math::geometry::rect nw se Construct a rectangle from its northwest and southeast corners and return it as the result of the command. ::math::geometry::nwse rect Extract the northwest and southeast corners of the rectangle and return them as the result of the command (a 2-element list contain- ing the points, in the named order). ::math::geometry::angle line Calculate the angle from the positive x-axis to a given line (in two dimensions only). list line Coordinates of the line ::math::geometry::calculateDistanceToLine P line Calculate the distance of point P to the (infinite) line and return the result list P List of two numbers, the coordinates of the point list line List of four numbers, the coordinates of two points on the line ::math::geometry::calculateDistanceToLineSegment P linesegment Calculate the distance of point P to the (finite) line segment and return the result. list P List of two numbers, the coordinates of the point list linesegment List of four numbers, the coordinates of the first and last points of the line segment ::math::geometry::calculateDistanceToPolyline P polyline Calculate the distance of point P to the polyline and return the result. list P List of two numbers, the coordinates of the point list polyline List of numbers, the coordinates of the vertices of the polyline ::math::geometry::findClosestPointOnLine P line Return the point on a line which is closest to a given point. list P List of two numbers, the coordinates of the point list line List of four numbers, the coordinates of two points on the line ::math::geometry::findClosestPointOnLineSegment P linesegment Return the point on a line segment which is closest to a given point. list P List of two numbers, the coordinates of the point list linesegment List of four numbers, the first and last points on the line segment ::math::geometry::findClosestPointOnPolyline P polyline Return the point on a polyline which is closest to a given point. list P List of two numbers, the coordinates of the point list polyline List of numbers, the vertices of the polyline ::math::geometry::lengthOfPolyline polyline Return the length of the polyline (note: it not regarded as a polygon) list polyline List of numbers, the vertices of the polyline ::math::geometry::movePointInDirection P direction dist Move a point over a given distance in a given direction and return the new coordinates (in two dimensions only). list P Coordinates of the point to be moved double direction Direction (in degrees; 0 is to the right, 90 upwards) list dist Distance over which to move the point ::math::geometry::lineSegmentsIntersect linesegment1 linesegment2 Check if two line segments intersect or coincide. Returns 1 if that is the case, 0 otherwise (in two dimensions only). list linesegment1 First line segment list linesegment2 Second line segment ::math::geometry::findLineSegmentIntersection linesegment1 linesegment2 Find the intersection point of two line segments. Return the coordinates or the keywords "coincident" or "none" if the line segments coincide or have no points in common (in two dimensions only). list linesegment1 First line segment list linesegment2 Second line segment ::math::geometry::findLineIntersection line1 line2 Find the intersection point of two (infinite) lines. Return the coordinates or the keywords "coincident" or "none" if the lines coincide or have no points in common (in two dimensions only). list line1 First line list line2 Second line See section References for details on the algorithm and math behind it. ::math::geometry::polylinesIntersect polyline1 polyline2 Check if two polylines intersect or not (in two dimensions only). list polyline1 First polyline list polyline2 Second polyline ::math::geometry::polylinesBoundingIntersect polyline1 polyline2 granularity Check whether two polylines intersect, but reduce the correctness of the result to the given granularity. Use this for faster, but weaker, intersection checking. How it works: Each polyline is split into a number of smaller polylines, consisting of granularity points each. If a pair of those smaller lines' bounding boxes intersect, then this procedure returns 1, otherwise it returns 0. list polyline1 First polyline list polyline2 Second polyline int granularity Number of points in each part (<=1 means check every edge) ::math::geometry::intervalsOverlap y1 y2 y3 y4 strict Check if two intervals overlap. double y1,y2 Begin and end of first interval double y3,y4 Begin and end of second interval logical strict Check for strict or non-strict overlap ::math::geometry::rectanglesOverlap P1 P2 Q1 Q2 strict Check if two rectangles overlap. list P1 upper-left corner of the first rectangle list P2 lower-right corner of the first rectangle list Q1 upper-left corner of the second rectangle list Q2 lower-right corner of the second rectangle list strict choosing strict or non-strict interpretation ::math::geometry::bbox polyline Calculate the bounding box of a polyline. Returns a list of four coordinates: the upper-left and the lower-right corner of the box. list polyline The polyline to be examined ::math::geometry::pointInsidePolygon P polyline Determine if a point is completely inside a polygon. If the point touches the polygon, then the point is not completely inside the polygon. list P Coordinates of the point list polyline The polyline to be examined ::math::geometry::rectangleInsidePolygon P1 P2 polyline Determine if a rectangle is completely inside a polygon. If polygon touches the rectangle, then the rectangle is not complete inside the polygon. list P1 Upper-left corner of the rectangle list P2 Lower-right corner of the rectangle list polygon The polygon in question ::math::geometry::areaPolygon polygon Calculate the area of a polygon. list polygon The polygon in question REFERENCES
[1] Polygon Intersection [http:/wiki.tcl.tk/12070] [2] http://en.wikipedia.org/wiki/Line-line_intersection [3] http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category math :: geometry of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
angle, distance, line, math, plane geometry, point CATEGORY
Mathematics COPYRIGHT
Copyright (c) 2001 by Ideogramic ApS and other parties Copyright (c) 2004 by Arjen Markus Copyright (c) 2010 by Andreas Kupries Copyright (c) 2010 by Kevin Kenny math 1.1.2 math::geometry(3tcl)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy